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


C++ QDBusMessage::errorName方法代码示例

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


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

示例1: code

/*!
    \internal
    Constructs a QDBusError from a QDBusMessage.
*/
QDBusError::QDBusError(const QDBusMessage &qdmsg)
    : code(NoError)
{
    if (qdmsg.type() != QDBusMessage::ErrorMessage)
        return;

    code = ::get(qdmsg.errorName().toUtf8().constData());
    nm = qdmsg.errorName();
    msg = qdmsg.errorMessage();
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:14,代码来源:qdbuserror.cpp

示例2: resumeDone

void HalSuspendJob::resumeDone(const QDBusMessage &reply)
{
    if (reply.type() == QDBusMessage::ErrorMessage)
    {
        // We ignore the NoReply error, since we can timeout anyway
        // if the computer is suspended for too long.
        if (reply.errorName() != "org.freedesktop.DBus.Error.NoReply")
        {
            setError(1);
            setErrorText(reply.errorName()+": "+reply.arguments().at(0).toString());
        }
    }

    emitResult();
}
开发者ID:KDE,项目名称:kde-workspace,代码行数:15,代码来源:halsuspendjob.cpp

示例3: LockPhone

void SIMLockService::LockPhone()
{
    //dbus-send --system --type=method_call
    //--dest=com.nokia.system_ui /com/nokia/system_ui/request com.nokia.system_ui.request.devlock_open
    //string:"com.nokia.mce"
    //string:"/com/nokia/mce/request"
    //string:"com.nokia.mce.request"
    //string:"devlock_callback"
    //uint32:'3'


	QDBusMessage reply = LockInterface->call("devlock_open",
						 "com.nokia.mce",
						 "/com/nokia/mce/request",
						 "com.nokia.mce.request",
						 "devlock_callback", (quint32)3);



	if(reply.type() == QDBusMessage::ErrorMessage)
	    qDebug() << "Failed to lock phone:" << reply.errorName() << reply.errorMessage();

	if(reply.arguments()[0].toBool() == true)
	    qDebug() << "Phone locked";
	else
	    qDebug() << "Phone failed to lock";


}
开发者ID:SierraSoftworks,项目名称:simlock,代码行数:29,代码来源:simlockservice.cpp

示例4: dbusGetProperty

/************************************************
 Helper func
 ************************************************/
bool dbusGetProperty(const QString &service,
                     const QString &path,
                     const QString &interface,
                     const QDBusConnection &connection,
                     const QString & property
                    )
{
    QDBusInterface dbus(service, path, interface, connection);
    if (!dbus.isValid())
    {
        qWarning() << "dbusGetProperty: QDBusInterface is invalid" << service << path << interface << property;
//        Notification::notify(QObject::tr("LXQt Power Manager"),
//                                  "lxqt-logo.png",
//                                  QObject::tr("Power Manager Error"),
//                                  QObject::tr("QDBusInterface is invalid")+ "\n\n" + service +" " + path +" " + interface +" " + property);

        return false;
    }

    QDBusMessage msg = dbus.call("Get", dbus.interface(), property);

    if (!msg.errorName().isEmpty())
    {
        printDBusMsg(msg);
//        Notification::notify(QObject::tr("LXQt Power Manager"),
//                                  "lxqt-logo.png",
//                                  QObject::tr("Power Manager Error (Get Property)"),
//                                  msg.errorName() + "\n\n" + msg.errorMessage());
    }

    return !msg.arguments().isEmpty() &&
            msg.arguments().first().value<QDBusVariant>().variant().toBool();
}
开发者ID:siduction-upstream,项目名称:liblxqt,代码行数:36,代码来源:lxqtpowerproviders.cpp

示例5: printDBusMsg

/************************************************
 Helper func
 ************************************************/
void printDBusMsg(const QDBusMessage &msg)
{
    qWarning() << "** Dbus error **************************";
    qWarning() << "Error name " << msg.errorName();
    qWarning() << "Error msg  " << msg.errorMessage();
    qWarning() << "****************************************";
}
开发者ID:siduction-upstream,项目名称:liblxqt,代码行数:10,代码来源:lxqtpowerproviders.cpp

示例6: disconnectDevice

void NetworkDevice::disconnectDevice()
{
    QDBusMessage query = m_networkDeviceInterface->call("Disconnect");
    if(query.type() != QDBusMessage::ReplyMessage)
        qCWarning(dcNetworkManager()) << query.errorName() << query.errorMessage();

}
开发者ID:lampi87,项目名称:guh,代码行数:7,代码来源:networkdevice.cpp

示例7: dbusCall

/************************************************
 Helper func

 Just like dbusCall(), except that systemd
 returns a string instead of a bool, and it takes
 an "interactivity boolean" as an argument.
 ************************************************/
static bool dbusCallSystemd(const QString &service,
                     const QString &path,
                     const QString &interface,
                     const QDBusConnection &connection,
                     const QString &method,
                     bool needBoolArg,
                     PowerProvider::DbusErrorCheck errorCheck = PowerProvider::CheckDBUS
                     )
{
    QDBusInterface dbus(service, path, interface, connection);
    if (!dbus.isValid())
    {
        qWarning() << "dbusCall: QDBusInterface is invalid" << service << path << interface << method;
        if (errorCheck == PowerProvider::CheckDBUS)
        {
            Notification::notify(
                                    QObject::tr("Power Manager Error"),
                                    QObject::tr("QDBusInterface is invalid")+ "\n\n" + service + " " + path + " " + interface + " " + method,
                                    "lxqt-logo.png");
        }
        return false;
    }

    QDBusMessage msg = dbus.call(method, needBoolArg ? QVariant(true) : QVariant());

    if (!msg.errorName().isEmpty())
    {
        printDBusMsg(msg);
        if (errorCheck == PowerProvider::CheckDBUS)
        {
            Notification::notify(
                                    QObject::tr("Power Manager Error (D-BUS call)"),
                                    msg.errorName() + "\n\n" + msg.errorMessage(),
                                    "lxqt-logo.png");
        }
    }

    // If the method no returns value, we believe that it was successful.
    if (msg.arguments().isEmpty() || msg.arguments().first().isNull())
        return true;

    QString response = msg.arguments().first().toString();
    qDebug() << "systemd:" << method << "=" << response;
    return response == "yes" || response == "challenge";
}
开发者ID:siduction-upstream,项目名称:liblxqt,代码行数:52,代码来源:lxqtpowerproviders.cpp

示例8: processReply

//
// Function to process the reply from a dbus call.
QDBusMessage::MessageType shared::processReply(const QDBusMessage& reply)
{
  if (reply.type() != QDBusMessage::ReplyMessage) {
    QMessageBox::warning(0,
        QString(TranslateStrings::cmtr("cmst") + qApp->translate("processReply", " Warning") ),
        qApp->translate("processReply",
          "<center><b>We received a DBUS reply message indicating an error.</b></center>"
          "<br><br>Error Name: %1<br><br>Error Message: %2")
            .arg(reply.errorName())
            .arg(TranslateStrings::cmtr(reply.errorMessage())) );
   } // if reply is something other than a normal reply message

  return reply.type();
}
开发者ID:andrew-bibb,项目名称:cmst,代码行数:16,代码来源:shared.cpp

示例9: tLog

/**
 * Handle the DBus reply triggered by FdoNotifyPlugin::nowPlaying
 */
void
FdoNotifyPlugin::dbusPlayingReplyReceived( QDBusPendingCallWatcher* watcher )
{
    QDBusMessage reply = watcher->reply();
    watcher->deleteLater();

    if ( reply.type() == QDBusMessage::ErrorMessage )
    {
        tLog(LOGVERBOSE) << "Failed to grab media keys" << reply.errorName() << reply.errorMessage();
        return;
    }

    const QVariantList& list = reply.arguments();
    if ( !list.isEmpty() )
        m_nowPlayingId = list.first().toInt();
}
开发者ID:AidedPolecat6,项目名称:tomahawk,代码行数:19,代码来源:FdoNotifyPlugin.cpp

示例10: debugVariantList

QDebug operator<<(QDebug dbg, const QDBusMessage &msg)
{
    dbg.nospace() << "QDBusMessage(type=" << msg.type()
                  << ", service=" << msg.service();
    if (msg.type() == QDBusMessage::MethodCallMessage ||
        msg.type() == QDBusMessage::SignalMessage)
        dbg.nospace() << ", path=" << msg.path()
                      << ", interface=" << msg.interface()
                      << ", member=" << msg.member();
    if (msg.type() == QDBusMessage::ErrorMessage)
        dbg.nospace() << ", error name=" << msg.errorName()
                      << ", error message=" << msg.errorMessage();
    dbg.nospace() << ", signature=" << msg.signature()
                  << ", contents=(";
    debugVariantList(dbg, msg.arguments());
    dbg.nospace() << ") )";
    return dbg.space();
}
开发者ID:Afreeca,项目名称:qt,代码行数:18,代码来源:qdbusmessage.cpp

示例11: callFinishedSlot

void QuickDBusReply::callFinishedSlot(QDBusPendingCallWatcher *call)
{
    Q_ASSERT(call);

    setWaiting(false);

    QDBusMessage msg = call->reply();

    if (msg.type() == QDBusMessage::ReplyMessage) {
        setValues(msg.arguments());
    } else {
        setValid(false);
        setErrorName(msg.errorName());
        setErrorString(msg.errorMessage());
    }

    call->deleteLater();
}
开发者ID:qtproject,项目名称:playground-qmldbusplugin,代码行数:18,代码来源:dbusreply.cpp

示例12: startCamera

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, "");
    }
}
开发者ID:jsoref,项目名称:incubator-cordova-qt,代码行数:44,代码来源:camera.cpp

示例13: RegisterFinished

void GnomeGlobalShortcutBackend::RegisterFinished(
    QDBusPendingCallWatcher* watcher) {
#ifdef QT_DBUS_LIB
  QDBusMessage reply = watcher->reply();
  watcher->deleteLater();

  if (reply.type() == QDBusMessage::ErrorMessage) {
    qLog(Warning) << "Failed to grab media keys" << reply.errorName()
                  << reply.errorMessage();
    return;
  }

  connect(interface_, SIGNAL(MediaPlayerKeyPressed(QString, QString)), this,
          SLOT(GnomeMediaKeyPressed(QString, QString)));
  is_connected_ = true;

  qLog(Debug) << "registered";
#endif  // QT_DBUS_LIB
}
开发者ID:Gu1,项目名称:Clementine,代码行数:19,代码来源:gnomeglobalshortcutbackend.cpp

示例14: qDebug

void
Mp3tunesAmarokClient::harmonyDownloadReady( const Mp3tunesHarmonyDownload &download )
{
    qDebug() << "Got message about ready: " << download.trackTitle() << " by " << download.artistName() << " on " << download. albumTitle();
    QString name = "org.kde.amarok";
    QDBusMessage m = QDBusMessage::createMethodCall( name,
                                               "/Mp3tunesHarmonyHandler",
                                               "",
                                               "emitDownloadReady" );
    QList<QVariant> args;
    args.append( download.serialize() );
    m.setArguments(args);
    QDBusMessage response = QDBusConnection::sessionBus().call( m );
    if( response.type() == QDBusMessage::ErrorMessage )
    {
            qDebug() << "Got ERROR response harmonyDownloadReady";
            qDebug() << response.errorName() << ":  " << response.errorMessage();
    }
}
开发者ID:weiligang512,项目名称:apue-test,代码行数:19,代码来源:AmarokClient.cpp

示例15: QString

void Mp3tunesAmarokClient::dbusEmitMessage( const QString &message, const QString &param = QString() )
{
    QString name = "org.kde.amarok";
    QDBusMessage m = QDBusMessage::createMethodCall( name,
                                               "/Mp3tunesHarmonyHandler",
                                               "",
                                               message );
    if( !param.isEmpty() )
    {
      QList<QVariant> args;
      args.append( param );
      m.setArguments(args);
    }
    QDBusMessage response = QDBusConnection::sessionBus().call( m );
    if( response.type() == QDBusMessage::ErrorMessage )
    {
            qDebug() << "Got ERROR response " << message;
            qDebug() << response.errorName() << ":  " << response.errorMessage();
    }
}
开发者ID:weiligang512,项目名称:apue-test,代码行数:20,代码来源:AmarokClient.cpp


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