void RemoteInterfaceConnection::icPropertiesChanged(const QVariantMap &changedProperties)
{
    Q_D(RemoteInterfaceConnection);
    QStringList propKeys = changedProperties.keys();
    QLatin1String connectionTypeKey("connectionType"),
                  uuidKey("uuid"),
                  nameKey("name"),
                  iconNameKey("iconName"),
                  activationStateKey("activationState"),
                  hasDefaultRouteKey("hasDefaultRoute");
    QVariantMap::const_iterator it = changedProperties.find(connectionTypeKey);
    if (it != changedProperties.end()) {
        d->connectionType = (Knm::Connection::Type)it->toUInt();
        propKeys.removeOne(connectionTypeKey);
    }
    it = changedProperties.find(uuidKey);
    if (it != changedProperties.end()) {
        d->uuid = it->toString();
        propKeys.removeOne(uuidKey);
    }
    it = changedProperties.find(nameKey);
    if (it != changedProperties.end()) {
        d->name = it->toString();
        propKeys.removeOne(nameKey);
    }
    it = changedProperties.find(iconNameKey);
    if (it != changedProperties.end()) {
        d->iconName = it->toString();
        propKeys.removeOne(iconNameKey);
    }
    it = changedProperties.find(activationStateKey);
    if (it != changedProperties.end()) {
        d->oldActivationState = d->activationState;
        d->activationState = (Knm::InterfaceConnection::ActivationState)it->toUInt();
        emit activationStateChanged(d->oldActivationState, d->activationState);
        propKeys.removeOne(activationStateKey);
    }
    it = changedProperties.find(hasDefaultRouteKey);
    if (it != changedProperties.end()) {
        d->hasDefaultRoute = it->toBool();
        emit hasDefaultRouteChanged(d->hasDefaultRoute);
        propKeys.removeOne(hasDefaultRouteKey);
    }
    /*if (propKeys.count()) {
        kDebug() << "Unhandled properties: " << propKeys;
    }*/
    emit changed();
}
Exemplo n.º 2
0
void RemoteActivatable::propertiesChanged(const QVariantMap &changedProperties)
{
    Q_D(RemoteActivatable);
    QStringList propKeys = changedProperties.keys();
    QLatin1String deviceUniKey("deviceUni"),
                  activatableTypeKey("activatableType"),
                  sharedKey("shared");
    QVariantMap::const_iterator it = changedProperties.find(deviceUniKey);
    if (it != changedProperties.end())
    {
        d->deviceUni = it->toString();
        propKeys.removeOne(deviceUniKey);
    }
    it = changedProperties.find(activatableTypeKey);
    if (it != changedProperties.end())
    {
        d->activatableType = (Knm::Activatable::ActivatableType)it->toUInt();
        propKeys.removeOne(activatableTypeKey);
    }
    it = changedProperties.find(sharedKey);
    if (it != changedProperties.end())
    {
        d->shared = it->toBool();
        propKeys.removeOne(sharedKey);
    }
    /*if (propKeys.count()) {
        qDebug() << "Unhandled properties: " << propKeys;
    }*/
}
Exemplo n.º 3
0
void ModemManager::ModemCdmaPrivate::onPropertiesChanged(const QString &interface, const QVariantMap &properties, const QStringList &invalidatedProps)
{
    Q_Q(ModemCdma);
    Q_UNUSED(invalidatedProps);
    qCDebug(MMQT) << interface << properties.keys();

    if (interface == QString(MMQT_DBUS_INTERFACE_MODEM_MODEMCDMA)) {
        QVariantMap::const_iterator it = properties.constFind(QLatin1String(MM_MODEM_MODEMCDMA_PROPERTY_ACTIVATIONSTATE));
        if (it != properties.constEnd()) {
            // Should be handled by activationStateChanged signal
        }
        it = properties.constFind(QLatin1String(MM_MODEM_MODEMCDMA_PROPERTY_MEID));
        if (it != properties.constEnd()) {
            meid = it->toString();
            Q_EMIT q->meidChanged(meid);
        }
        it = properties.constFind(QLatin1String(MM_MODEM_MODEMCDMA_PROPERTY_ESN));
        if (it != properties.constEnd()) {
            esn = it->toString();
            Q_EMIT q->esnChanged(esn);
        }
        it = properties.constFind(QLatin1String(MM_MODEM_MODEMCDMA_PROPERTY_SID));
        if (it != properties.constEnd()) {
            sid = it->toUInt();
            Q_EMIT q->sidChanged(sid);
        }
        it = properties.constFind(QLatin1String(MM_MODEM_MODEMCDMA_PROPERTY_NID));
        if (it != properties.constEnd()) {
            nid = it->toUInt();
            Q_EMIT q->nidChanged(nid);
        }
        it = properties.constFind(QLatin1String(MM_MODEM_MODEMCDMA_PROPERTY_CDMA1XREGISTRATIONSTATE));
        if (it != properties.constEnd()) {
            cdma1xRegistrationState = (MMModemCdmaRegistrationState)it->toUInt();
            Q_EMIT q->cdma1xRegistrationStateChanged(cdma1xRegistrationState);
        }
        it = properties.constFind(QLatin1String(MM_MODEM_MODEMCDMA_PROPERTY_EVDOREGISTRATIONSTATE));
        if (it != properties.constEnd()) {
            evdoRegistrationState = (MMModemCdmaRegistrationState)it->toUInt();
            Q_EMIT q->evdoRegistrationStateChanged(evdoRegistrationState);
        }
    }
}