コード例 #1
0
ファイル: keyboard_applet.cpp プロジェクト: KDE/kde-workspace
KeyboardApplet::~KeyboardApplet()
{
    QDBusConnection dbus = QDBusConnection::sessionBus();
    dbus.disconnect(QString(), KEYBOARD_DBUS_OBJECT_PATH, KEYBOARD_DBUS_SERVICE_NAME, KEYBOARD_DBUS_CONFIG_RELOAD_MESSAGE, this, SLOT(configChanged()));

    delete layoutsMenu;
    delete rules;
}
コード例 #2
0
void Camera::startCamera()
{
    QDBusConnection bus = QDBusConnection::sessionBus();

    bus.connect("com.nokia.maemo.CameraService",
                "/",
                "com.nokia.maemo.meegotouch.CameraInterface",
                "captureCanceled",
                this, SLOT(captureCanceled(QString)));

    bus.connect("com.nokia.maemo.CameraService",
                "/",
                "com.nokia.maemo.meegotouch.CameraInterface",
                "captureCompleted",
                this, SLOT(captureCompleted(QString,QString)));

    QDBusMessage message = QDBusMessage::createMethodCall(
                "com.nokia.maemo.CameraService",
                "/",
                "com.nokia.maemo.meegotouch.CameraInterface",
                "showCamera");

    QList<QVariant> args;
    args << (uint)0 << "" << "still-capture" << true;
    message.setArguments(args);

    QDBusMessage reply = bus.call(message);
    if (reply.type() == QDBusMessage::ErrorMessage) {
        qDebug() << Q_FUNC_INFO << "reply.type == errormessage; name=" << reply.errorName() << "; message=" << reply.errorMessage();
        bus.disconnect("com.nokia.maemo.CameraService",
                    "/",
                    "com.nokia.maemo.meegotouch.CameraInterface",
                    "captureCanceled",
                    this, SLOT(captureCanceled(QString)));

        bus.disconnect("com.nokia.maemo.CameraService",
                    "/",
                    "com.nokia.maemo.meegotouch.CameraInterface",
                    "captureCompleted",
                    this, SLOT(captureCompleted(QString,QString)));
        if (m_lastEcId)
            this->callback(m_lastEcId, "");
    }
}
コード例 #3
0
void Camera::captureCompleted(const QString &mode, const QString &fileName)
{
    Q_UNUSED(mode);
    qDebug() << Q_FUNC_INFO;
    QDBusConnection bus = QDBusConnection::sessionBus();
    bus.disconnect("com.nokia.maemo.CameraService",
                "/",
                "com.nokia.maemo.meegotouch.CameraInterface",
                "captureCanceled",
                this, SLOT(captureCanceled(QString)));

    bus.disconnect("com.nokia.maemo.CameraService",
                "/",
                "com.nokia.maemo.meegotouch.CameraInterface",
                "captureCompleted",
                this, SLOT(captureCompleted(QString,QString)));
    if (m_lastScId)
        this->callback(m_lastScId, QString("\"%1\"").arg(fileName));
}
コード例 #4
0
void QGeoSatelliteInfoSourceGeoclueMaster::positionProviderChanged(const QString &name,
                                                                   const QString &description,
                                                                   const QString &service,
                                                                   const QString &path)
{
    Q_UNUSED(name)
    Q_UNUSED(description)

    cleanupSatelliteSource();

    QString providerService;
    QString providerPath;

    if (service.isEmpty() || path.isEmpty()) {
        // No valid position provider has been selected. This probably means that the GPS provider
        // has not yet obtained a position fix. It can still provide satellite information though.
        if (!m_satellitesChangedConnected) {
            QDBusConnection conn = QDBusConnection::sessionBus();
            conn.connect(QString(), QString(), QStringLiteral("org.freedesktop.Geoclue.Satellite"),
                         QStringLiteral("SatelliteChanged"), this,
                         SLOT(satelliteChanged(QDBusMessage)));
            m_satellitesChangedConnected = true;
            return;
        }
    } else {
        if (m_satellitesChangedConnected) {
            QDBusConnection conn = QDBusConnection::sessionBus();
            conn.disconnect(QString(), QString(),
                            QStringLiteral("org.freedesktop.Geoclue.Satellite"),
                            QStringLiteral("SatelliteChanged"), this,
                            SLOT(satelliteChanged(QDBusMessage)));
            m_satellitesChangedConnected = false;
        }

        providerService = service;
        providerPath = path;
    }

    if (providerService.isEmpty() || providerPath.isEmpty()) {
        m_error = AccessError;
        emit QGeoSatelliteInfoSource::error(m_error);
        return;
    }

    m_provider = new OrgFreedesktopGeoclueInterface(providerService, providerPath, QDBusConnection::sessionBus());
    m_provider->AddReference();

    m_sat = new OrgFreedesktopGeoclueSatelliteInterface(providerService, providerPath, QDBusConnection::sessionBus());

    if (m_running) {
        connect(m_sat, SIGNAL(SatelliteChanged(qint32,qint32,qint32,QList<qint32>,QList<QGeoSatelliteInfo>)),
                this, SLOT(satelliteChanged(qint32,qint32,qint32,QList<qint32>,QList<QGeoSatelliteInfo>)));
    }
}
コード例 #5
0
ファイル: mprisplayer.cpp プロジェクト: AlexeyProkhin/qutim
	void MprisPlayer::stopWatching()
	{
		QDBusConnection bus = QDBusConnection::sessionBus();
		if (m_version == 1) {
			bus.disconnect(m_service,
						   "/Player",
						   "org.freedesktop.MediaPlayer",
						   "TrackChange",
						   this, SLOT(onTrackChanged(QVariantMap)));
			bus.disconnect(m_service,
						   "/Player",
						   "org.freedesktop.MediaPlayer",
						   "StatusChange",
						   this, SLOT(statusChanged(DBusMprisPlayerStatus)));
		} else if (m_version == 2) {
			bus.disconnect(m_service,
						   QLatin1String("/org/mpris/MediaPlayer2"),
						   QLatin1String("org.freedesktop.DBus.Properties"),
						   QLatin1String("PropertiesChanged"),
						   this, SLOT(onPropertiesChanged(QDBusMessage)));
		}
    }