Example #1
0
bool QNetworkManagerSettingsConnection::setConnections()
{
    if(!isValid() )
        return false;

    bool allOk = false;
    if(!nmConnection.connect(d->service, d->path,
                             QLatin1String(NM_DBUS_IFACE_SETTINGS_CONNECTION), QLatin1String("Updated"),
                             this, SIGNAL(updated(QNmSettingsMap)))) {
        allOk = true;
    } else {
        QDBusError error = nmConnection.lastError();
    }

    delete nmDBusHelper;
    nmDBusHelper = new QNmDBusHelper(this);
    connect(nmDBusHelper, SIGNAL(pathForSettingsRemoved(QString)),
            this,SIGNAL(removed(QString)));

    if (!nmConnection.connect(d->service, d->path,
                              QLatin1String(NM_DBUS_IFACE_SETTINGS_CONNECTION), QLatin1String("Removed"),
                              nmDBusHelper, SIGNAL(slotSettingsRemoved()))) {
        allOk = true;
    }

    return allOk;
}
Example #2
0
void QNmDBusHelper::slotSettingsRemoved()
{
    QDBusMessage msg = this->message();
    emit pathForSettingsRemoved(msg.path());
}