Exemplo n.º 1
0
/* Remove uinput device, stop threads and unregister from dbus
 */
Tohkbd::~Tohkbd()
{
    /* Restore orientation when shutting down */
    if (forceLandscapeOrientation)
    {
        QList<QVariant> args;
        args.append(currentOrientationLock);
        tohkbd2user->callWithArgumentList(QDBus::AutoDetect, "setOrientationLock", args);
    }

    uinputif->closeUinputDevice();

    worker->abort();
    thread->wait();
    delete thread;
    delete worker;

    if (dbusRegistered)
    {
        QDBusConnection connection = QDBusConnection::systemBus();
        connection.unregisterObject(PATH);
        connection.unregisterService(SERVICE);

        printf("tohkbd2: unregistered from dbus systemBus\n");
        tohkbd2user->call(QDBus::AutoDetect, "quit");
    }
}
Exemplo n.º 2
0
/*!
    Destroy this QCop service handling object.
*/
QtopiaAbstractService::~QtopiaAbstractService()
{
#if defined(QTOPIA_DBUS_IPC)
    QDBusConnection dbc = QDBus::sessionBus();
    if (!dbc.isConnected()) {
        qWarning() << "Unable to connect to D-BUS:" << dbc.lastError();
        return;
    }

    qLog(Services) << "Unregistering service" << m_data->m_service;

    QString path = dbusPathBase;
    path.append(m_data->m_service);
    dbc.unregisterObject(path);

    QDBusConnectionInterface *iface = dbc.interface();
    QString service = dbusInterface;
    service.append(".");
    service.append(m_data->m_service);

    iface->unregisterService(service);
#endif

    if (m_data)
        delete m_data;
}
Exemplo n.º 3
0
/* Remove uinput device, stop threads and unregister from dbus
 */
Tohkbd::~Tohkbd()
{
    /* Restore orientation when shutting down */
    if (forceLandscapeOrientation)
    {
        tohkbd2user->setOrientationLock(currentOrientationLock);
    }

    uinputif->closeUinputDevice();

    worker->abort();
    thread->wait();
    delete thread;
    delete worker;

    if (dbusRegistered)
    {
        QDBusConnection connection = QDBusConnection::systemBus();
        connection.unregisterObject(PATH);
        connection.unregisterService(SERVICE);

        printf("tohkbd2: unregistered from dbus systemBus\n");
        tohkbd2user->quit();
    }
}
Exemplo n.º 4
0
 // ---------------------------------------------------------------------------------
 void detail::object_to_unregister_from_dbus::from ( QDBusConnection con )
 {
   if ( !con.isConnected() )
   {
     return;
   }
   if ( con.objectRegisteredAt ( _M_path ) != 0 )
   {
     con.unregisterObject ( _M_path );
   }
 }
    void SignonIdentity::destroy()
    {
        if (m_registered)
        {
            emit unregistered();
            QDBusConnection connection = SIGNOND_BUS;
            connection.unregisterObject(objectName());
            m_registered = false;
        }

        deleteLater();
    }
Exemplo n.º 6
0
SyncBackup::~SyncBackup()
{
    FUNCTION_CALL_TRACE;
    iBackupRestore = false;
    //Unregister from D-Bus.
    QDBusConnection dbus = SyncDBusConnection::sessionBus();
    dbus.unregisterObject(DBUS_BACKUP_OBJECT);
    delete iWatchService;
    iWatchService = 0;
    delete iAdaptor;
    iAdaptor = 0;
    LOG_DEBUG("Unregistered backup from D-Bus");
}
Exemplo n.º 7
0
void SearchManager::quit()
{
    QDBusConnection conn = DBusConnectionPool::threadConnection();
    conn.unregisterObject(QStringLiteral("/SearchManager"), QDBusConnection::UnregisterTree);
    conn.disconnectFromBus(conn.name());

    // Make sure all childrens are deleted within context of this thread
    qDeleteAll(children());

    qDeleteAll(mEngines);
    qDeleteAll(mPlugins);
    Q_FOREACH (QPluginLoader *loader, mPluginLoaders) {
        loader->unload();
        delete loader;
    }
Exemplo n.º 8
0
void SkypeConnection::disconnectSkype(skypeCloseReason reason) {
	kDebug(SKYPE_DEBUG_GLOBAL);

	QDBusConnection busConn = BUS;
	busConn.unregisterObject("/com/Skype/Client");

	if (d->startTimer) {
		d->startTimer->stop();
		d->startTimer->deleteLater();
		d->startTimer = 0L;
	}

	d->fase = cfNotConnected;//No longer connected
	emit connectionDone(seCanceled, 0);
	emit connectionClosed(reason);//we disconnect
}
Exemplo n.º 9
0
void JobViewServer::startServer() {
  QDBusConnection bus = QDBusConnection::sessionBus();
  bus.unregisterService("org.kde.kuiserver"); 
  bus.unregisterService("org.kde.JobViewServer");
  bus.unregisterObject("/JobViewServer");
  if (bus.registerService("org.kde.kuiserver") && bus.registerService("org.kde.JobViewServer") && bus.registerObject("/JobViewServer", this)) {
    connected = true;
  } else {
    connected = false;
    QDBusServiceWatcher* watcher = new QDBusServiceWatcher("org.kde.kuiserver", bus, QDBusServiceWatcher::WatchForUnregistration, this);
    QDBusServiceWatcher* watcher2 = new QDBusServiceWatcher("org.kde.JobViewServer", bus, QDBusServiceWatcher::WatchForUnregistration, this);
    QObject::connect(watcher, SIGNAL(serviceUnregistered(QString)), this, SLOT(startServer()));
    QObject::connect(watcher, SIGNAL(serviceUnregistered(QString)), watcher, SLOT(deleteLater()));
    QObject::connect(watcher2, SIGNAL(serviceUnregistered(QString)), this, SLOT(startServer()));
    QObject::connect(watcher2, SIGNAL(serviceUnregistered(QString)), watcher2, SLOT(deleteLater()));
  }
  updateStatusIndicators();
}
Exemplo n.º 10
0
Interface::~Interface()
{
    QDBusConnection dbus = QDBusConnection::sessionBus();
    dbus.unregisterObject( "/MainWindow" );
    dbus.unregisterService( "org.k3b.k3b" );
}