void QOfonoMessageWaiting::getPropertiesFinished(const QVariantMap &properties, const QDBusError *error)
{
    SUPER::getPropertiesFinished(properties, error);
    if (error) {
        Q_EMIT getPropertiesFailed();
    }
}
Ejemplo n.º 2
0
void QOfonoMessageWaiting::connectOfono()
{
    bool wasReady = isReady();
    // FIXME: Clearing properties here results in false *Changed signal
    // emissions. Ideally ready() should not be derived from
    // properties.isEmpty(). Also compare with QOfonoSimManager.
    if (d_ptr->messageWaiting) {
        delete d_ptr->messageWaiting;
        d_ptr->messageWaiting = 0;
        d_ptr->properties.clear();
    }

    d_ptr->messageWaiting = new OfonoMessageWaiting("org.ofono", d_ptr->modemPath, QDBusConnection::systemBus(),this);

    if (d_ptr->messageWaiting->isValid()) {
        connect(d_ptr->messageWaiting,SIGNAL(PropertyChanged(QString,QDBusVariant)),
                this,SLOT(propertyChanged(QString,QDBusVariant)));

        QDBusPendingReply<QVariantMap> reply;
        reply = d_ptr->messageWaiting->GetProperties();
        reply.waitForFinished();
        if (reply.isError()) {
            Q_EMIT getPropertiesFailed();
        } else {
            QVariantMap properties = reply.value();
            for (QVariantMap::ConstIterator it = properties.constBegin();
                    it != properties.constEnd(); ++it) {
                updateProperty(it.key(), it.value());
            }
        }
    }

    if (wasReady != isReady())
        Q_EMIT readyChanged();
}
Ejemplo n.º 3
0
void QOfonoCallForwarding::getPropertiesComplete(QDBusPendingCallWatcher *call)
{
    QDBusPendingReply<QVariantMap> reply = *call;
    if (!reply.isError()) {
        d_ptr->properties = reply.value();
        Q_EMIT voiceUnconditionalChanged(voiceUnconditional());
        Q_EMIT voiceBusyChanged(voiceBusy());
        Q_EMIT voiceNoReplyChanged(voiceNoReply());
        Q_EMIT voiceNoReplyTimeoutChanged(voiceNoReplyTimeout());
        Q_EMIT voiceNotReachableChanged(voiceNotReachable());
        Q_EMIT forwardingFlagOnSimChanged(forwardingFlagOnSim());
        Q_EMIT readyChanged();
    } else {
        Q_EMIT getPropertiesFailed();
    }
    call->deleteLater();
}
Ejemplo n.º 4
0
void QOfonoCallSettings::getPropertiesComplete(QDBusPendingCallWatcher *call)
{
    call->deleteLater();
    QDBusPendingReply<QVariantMap> reply = *call;
    if (!reply.isError()) {
        d_ptr->properties = reply.value();
        Q_EMIT callingLinePresentationChanged(callingLinePresentation());
        Q_EMIT calledLinePresentationChanged(calledLinePresentation());
        Q_EMIT callingNamePresentationChanged(callingNamePresentation());
        Q_EMIT connectedLinePresentationChanged(connectedLinePresentation());
        Q_EMIT connectedLineRestrictionChanged(connectedLineRestriction());
        Q_EMIT callingLineRestrictionChanged(callingLineRestriction());
        Q_EMIT hideCallerIdChanged(hideCallerId());
        Q_EMIT voiceCallWaitingChanged(voiceCallWaiting());
        Q_EMIT readyChanged();
    } else {
        Q_EMIT getPropertiesFailed();
    }
    d_ptr->propertiesPending = false;
}