Ejemplo n.º 1
0
Archivo: gnet.c Proyecto: draringi/gini
/*
 * shutdown all interfaces.. used at router shutdown..
 */
void haltInterfaces()
{
	int i;

	for (i = 0; i < MAX_INTERFACES; i++)
		destroyInterface(netarray.elem[i]);
}
AbstractDBusServiceMonitor::AbstractDBusServiceMonitor(QString service, QString path,
                                                       QString interface, QObject *parent)
    : QObject(parent)
    , m_service(service)
    , m_path(path)
    , m_interface(interface)
    , m_watcher(new QDBusServiceWatcher(service, QDBusConnection::sessionBus()))
    , m_dbusInterface(0)
{
    connect(m_watcher, SIGNAL(serviceRegistered(QString)), SLOT(createInterface()));
    connect(m_watcher, SIGNAL(serviceUnregistered(QString)), SLOT(destroyInterface()));

    // Connect to the service if it's up already
    QDBusConnectionInterface* sessionBus = QDBusConnection::sessionBus().interface();
    QDBusReply<bool> reply = sessionBus->isServiceRegistered(m_service);
    if (reply.isValid() && reply.value()) {
        createInterface();
    }
}
Ejemplo n.º 3
0
Archivo: gnet.c Proyecto: draringi/gini
/*
 * destroyInterface by Index...
 */
int destroyInterfaceByIndex(int indx)
{
	return destroyInterface(findInterface(indx));
}