当前位置: 首页>>代码示例>>C++>>正文


C++ QDBusPendingReply::error方法代码示例

本文整理汇总了C++中QDBusPendingReply::error方法的典型用法代码示例。如果您正苦于以下问题:C++ QDBusPendingReply::error方法的具体用法?C++ QDBusPendingReply::error怎么用?C++ QDBusPendingReply::error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QDBusPendingReply的用法示例。


在下文中一共展示了QDBusPendingReply::error方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: onCallFinished

void PendingConnection::onCallFinished(QDBusPendingCallWatcher *watcher)
{
    QDBusPendingReply<QString, QDBusObjectPath> reply = *watcher;

    if (!reply.isError()) {
        QString busName = reply.argumentAt<0>();
        QString objectPath = reply.argumentAt<1>().path();

        debug() << "Got reply to ConnectionManager.CreateConnection - bus name:" <<
            busName << "- object path:" << objectPath;

        PendingReady *readyOp = manager()->connectionFactory()->proxy(busName,
                objectPath, manager()->channelFactory(), manager()->contactFactory());
        mPriv->connection = ConnectionPtr::qObjectCast(readyOp->proxy());
        connect(readyOp,
                SIGNAL(finished(Tp::PendingOperation*)),
                SLOT(onConnectionBuilt(Tp::PendingOperation*)));
    } else {
        debug().nospace() <<
            "CreateConnection failed: " <<
            reply.error().name() << ": " << reply.error().message();
        setFinishedWithError(reply.error());
    }

    watcher->deleteLater();
}
开发者ID:TelepathyQt,项目名称:telepathy-qt,代码行数:26,代码来源:pending-connection.cpp

示例2: OnAsyncReply

void PowerManagerNux::OnAsyncReply(QDBusPendingCallWatcher *call)
{
    if (m_state == request_idle)
    {
        QDBusPendingReply<> reply = *call;

        if(reply.isError())
        {
            qDebug("D-Bus: Reply: Error: %s", qPrintable(reply.error().message()));
            m_state = error;
        }
        else
        {
            m_state = idle;
            qDebug("D-Bus: PowerManagerInhibitor: Request successful");
            if (m_intended_state == busy)
                this->setState(1, QString::fromLatin1(""));
        }
    }
    else if (m_state == request_busy)
    {
        QDBusPendingReply<uint> reply = *call;

        if(reply.isError())
        {
            qDebug("D-Bus: Reply: Error: %s", qPrintable(reply.error().message()));

            if (!m_use_gsm)
            {
                qDebug("D-Bus: Falling back to org.gnome.SessionManager");
                m_use_gsm = true;
                m_state = idle;
                if (m_intended_state == busy)
                    // XXX
                    this->setState(1, QString("Busy"));
            }
            else
            {
                m_state = error;
            }
        }
        else
        {
            m_state = busy;
            m_cookie = reply.value();
            qDebug("D-Bus: PowerManagerInhibitor: Request successful, cookie is %d", m_cookie);
            if (m_intended_state == idle)
                // XXX
                this->setState(0, QString("Iddle"));
        }
    }
    else
    {
        qDebug("D-Bus: Unexpected reply in state %d", m_state);
        m_state = error;
    }

    call->deleteLater();
}
开发者ID:Roxee,项目名称:qt-roxeeplatipus,代码行数:59,代码来源:powermanagernux.cpp

示例3: onDBusClipboardSetContentsFinished

void QMirClientClipboard::onDBusClipboardSetContentsFinished(QDBusPendingCallWatcher *call)
{
    QDBusPendingReply<void> reply = *call;
    if (reply.isError()) {
        qCritical("QMirClientClipboard - Failed to set the system clipboard contents via D-Bus. %s, %s",
                qPrintable(reply.error().name()), qPrintable(reply.error().message()));
        // TODO: Might try again later a number of times...
    }
    call->deleteLater();
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:10,代码来源:qmirclientclipboard.cpp

示例4: sendMessageFinished

void QOfonoMessageManager::sendMessageFinished(QDBusPendingCallWatcher *call)
{
    QDBusPendingReply<QDBusObjectPath> reply = *call;
    bool ok = true;
    if (reply.isError()) {
        qWarning() << Q_FUNC_INFO << "failed:" << reply.error();
         d_ptr->errorMessage = reply.error().name() + " " + reply.error().message();
         ok = false;
    }
    Q_EMIT sendMessageComplete(ok, reply.value().path());
}
开发者ID:amtep,项目名称:libqofono,代码行数:11,代码来源:qofonomessagemanager.cpp

示例5: setProxy

Transaction::InternalError Daemon::setProxy(const QString& http_proxy, const QString& https_proxy, const QString& ftp_proxy, const QString& socks_proxy, const QString& no_proxy, const QString& pac)
{
    Q_D(Daemon);
    QDBusPendingReply<> r = d->daemon->SetProxy(http_proxy, https_proxy, ftp_proxy, socks_proxy, no_proxy, pac);
    r.waitForFinished();
    d->lastError = r.error();
    if (r.isError()) {
        return Transaction::parseError(r.error().name());
    } else {
        return Transaction::InternalErrorNone;
    }
}
开发者ID:kananoja,项目名称:PackageKit-Qt,代码行数:12,代码来源:daemon.cpp

示例6: registerFinished

void QOfonoNetworkOperator::registerFinished(QDBusPendingCallWatcher *call)
{
    QDBusPendingReply<> reply = *call;
    QOfonoNetworkOperator::Error error = NoError;
    QString errorString;

    if (reply.isError()) {
         qWarning() << "QOfonoNetworkOperator::registerOperator() failed:" << reply.error();
         error = errorNameToEnum(reply.error().name());
         errorString = reply.error().name() + " " + reply.error().message();
    }
    Q_EMIT registerComplete(error,errorString);
}
开发者ID:amtep,项目名称:libqofono,代码行数:13,代码来源:qofononetworkoperator.cpp

示例7: deflectFinished

void QOfonoVoiceCall::deflectFinished(QDBusPendingCallWatcher *call)
{
    QDBusPendingReply<> reply = *call;
    QOfonoVoiceCall::Error error = NoError;
    QString errorString;

    if (reply.isError()) {
         qWarning() << "QOfonoVoiceCall::deflect() failed:" << reply.error();
         error = errorNameToEnum(reply.error().name());
         errorString = reply.error().name() + " " + reply.error().message();
    }
    Q_EMIT deflectComplete(error, errorString);
}
开发者ID:amtep,项目名称:libqofono,代码行数:13,代码来源:qofonovoicecall.cpp

示例8: sendUserReply

void ConnectionAgentPlugin::sendUserReply(const QVariantMap &input)
{
    if (!connManagerInterface || !connManagerInterface->isValid()) {
        Q_EMIT errorReported("","ConnectionAgent not available");
        return;
    }
    QDBusPendingReply<> reply = connManagerInterface->sendUserReply(input);
    reply.waitForFinished();
    if (reply.isError()) {
        qDebug() << Q_FUNC_INFO << reply.error().message();
        Q_EMIT errorReported("",reply.error().message());
    }
}
开发者ID:mikkoharju,项目名称:connectionagent,代码行数:13,代码来源:connectionagentplugin.cpp

示例9: connectAudioFinished

void QOfonoHandsfreeAudioCard::connectAudioFinished(QDBusPendingCallWatcher *call)
{
    QDBusPendingReply<> reply = *call;
    QOfonoHandsfreeAudioCard::Error error = NoError;
    QString errorString;

    if (reply.isError()) {
         qWarning() << "QOfonoHandsfreeAudioCard::connectAudio() failed:" << reply.error();
         error = errorNameToEnum(reply.error().name());
         errorString = reply.error().name() + " " + reply.error().message();
    }

    emit connectAudioComplete(error, errorString);
}
开发者ID:amtep,项目名称:libqofono,代码行数:14,代码来源:qofonohandsfreeaudiocard.cpp

示例10: resetFinished

void QOfonoCallMeter::resetFinished(QDBusPendingCallWatcher *call)
{
    call->deleteLater();
    QDBusPendingReply<> reply = *call;
    QOfonoCallMeter::Error error = NoError;
    QString errorString;

    if (reply.isError()) {
        qWarning() << "QOfonoCallMeter::reset() failed:" << reply.error();
        error = errorNameToEnum(reply.error().name());
        errorString = reply.error().name() + " " + reply.error().message();
        Q_EMIT resetComplete(error,errorString);
    }
}
开发者ID:amccarthy,项目名称:libqofono,代码行数:14,代码来源:qofonocallmeter.cpp

示例11: onDBusClipboardGetContentsFinished

void QMirClientClipboard::onDBusClipboardGetContentsFinished(QDBusPendingCallWatcher* call)
{
    Q_ASSERT(call == mPendingGetContentsCall.data());

    QDBusPendingReply<QByteArray> reply = *call;
    if (reply.isError()) {
        qCritical("QMirClientClipboard - Failed to get system clipboard contents via D-Bus. %s, %s",
                qPrintable(reply.error().name()), qPrintable(reply.error().message()));
        // TODO: Might try again later a number of times...
    } else {
        QByteArray serializedMimeData = reply.argumentAt<0>();
        updateMimeData(serializedMimeData);
    }
    call->deleteLater();
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:15,代码来源:qmirclientclipboard.cpp

示例12: getPropertiesAsyncCallback

void NetworkRegistrationWatcher::getPropertiesAsyncCallback(QDBusPendingCallWatcher *watcher)
{
    QDBusPendingReply<QVariantMap> reply = *watcher;
    if (reply.error().isValid()) {
        log_error("DBus call to interface %s function GetProperties of path %s failed: %s",
                  interface().toStdString().c_str(),
                  objectPath().toStdString().c_str(),
                  reply.error().message().toStdString().c_str());
        return;
    }

    QVariantMap map = reply.argumentAt<0>();
    foreach (const QString &key, map.keys())
        emit propertyChanged(objectPath(), key, map.value(key));
}
开发者ID:special,项目名称:timed,代码行数:15,代码来源:networkregistrationwatcher.cpp

示例13: listCachedUsers

/*!
    Returns a list of user accounts.

    \param systemUsers If true, returns also system users.
*/
UserAccountList AccountsManager::listCachedUsers()
{
    Q_D(AccountsManager);

    UserAccountList list;

    QDBusPendingReply< QList<QDBusObjectPath> > reply = d->interface->ListCachedUsers();
    reply.waitForFinished();

    if (reply.isError()) {
        QDBusError error = reply.error();
        qWarning("Couldn't list cached users: %s",
                 error.errorString(error.type()).toUtf8().constData());
        return list;
    }

    QList<QDBusObjectPath> value = reply.argumentAt<0>();
    list.reserve(value.size());

    for (int i = 0; i < value.size(); i++) {
        const QString path = value.at(i).path();
        UserAccount *account = d->usersCache.value(path, Q_NULLPTR);
        if (!account) {
            account = new UserAccount(path, d->interface->connection());
            d->usersCache[path] = account;
        }
        list.append(account);
    }

    return list;
}
开发者ID:AOSC-Dev,项目名称:qtaccountsservice,代码行数:36,代码来源:accountsmanager.cpp

示例14: connectionActivePropertiesInterface

QNetworkManagerConnectionActive::QNetworkManagerConnectionActive(const QString &activeConnectionObjectPath, QObject *parent)
    : QDBusAbstractInterface(QLatin1String(NM_DBUS_SERVICE),
                             activeConnectionObjectPath,
                             NM_DBUS_INTERFACE_ACTIVE_CONNECTION,
                             QDBusConnection::systemBus(), parent)
{
    if (!isValid()) {
        return;
    }
    PropertiesDBusInterface connectionActivePropertiesInterface(QLatin1String(NM_DBUS_SERVICE),
                                                  activeConnectionObjectPath,
                                                  QLatin1String("org.freedesktop.DBus.Properties"),
                                                  QDBusConnection::systemBus());


    QList<QVariant> argumentList;
    argumentList << QLatin1String(NM_DBUS_INTERFACE_ACTIVE_CONNECTION);
    QDBusPendingReply<QVariantMap> propsReply
            = connectionActivePropertiesInterface.callWithArgumentList(QDBus::Block,QLatin1String("GetAll"),
                                                                       argumentList);

    if (!propsReply.isError()) {
        propertyMap = propsReply.value();
    } else {
        qWarning() << propsReply.error().message();
    }

    QDBusConnection::systemBus().connect(QLatin1String(NM_DBUS_SERVICE),
                                  activeConnectionObjectPath,
                                  QLatin1String(NM_DBUS_INTERFACE_ACTIVE_CONNECTION),
                                  QLatin1String("PropertiesChanged"),
                                  this,SLOT(propertiesSwap(QMap<QString,QVariant>)));
}
开发者ID:James-intern,项目名称:Qt,代码行数:33,代码来源:qnetworkmanagerservice.cpp

示例15: listCachedUsersAsync

/*!
    Cached a list of user accounts.
    Async unblocking API.
*/
void AccountsManager::listCachedUsersAsync()
{
    Q_D(AccountsManager);

    QDBusPendingCall call = d->interface->ListCachedUsers();
    QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(call, this);
    connect(watcher, &QDBusPendingCallWatcher::finished, this, [=](QDBusPendingCallWatcher *w) {
        QDBusPendingReply< QList<QDBusObjectPath> > reply = *w;
        w->deleteLater();
        if (reply.isError()) {
            QDBusError error = reply.error();
            qWarning("Couldn't list cached users: %s",
                     error.errorString(error.type()).toUtf8().constData());
        } else {
            UserAccountList userList;
            QList<QDBusObjectPath> value = reply.argumentAt<0>();
            userList.reserve(value.size());
            for (int i = 0; i < value.size(); i++) {
                const QString path = value.at(i).path();
                UserAccount *account = d->usersCache.value(path, Q_NULLPTR);
                if (!account) {
                    account = new UserAccount(path, d->interface->connection());
                    d->usersCache[path] = account;
                }
                userList.append(account);
            }
            Q_EMIT listCachedUsersFinished(userList);
        }
    });
}
开发者ID:AOSC-Dev,项目名称:qtaccountsservice,代码行数:34,代码来源:accountsmanager.cpp


注:本文中的QDBusPendingReply::error方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。