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


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

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


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

示例1: closeNotification

//
//  Function to force a close of a notification
void NotifyClient::closeNotification(quint32 id)
{
  // return if we don't have valid connection
  if (! b_validconnection) return; 
  
  QDBusMessage reply = notifyclient->call(QLatin1String("CloseNotification", id));
  
  if (reply.type() == QDBusMessage::InvalidMessage)
    qCritical("CMST - Invalid reply received to CloseNotification method.");
  
  else if (reply.type() == QDBusMessage::ErrorMessage) 
    qCritical("CMST - Error reply received to CloseNotification method: %s", qPrintable(reply.errorMessage()) );
  
  return;
}
开发者ID:afontenot,项目名称:cmst,代码行数:17,代码来源:notify.cpp

示例2: testNotificationActivated

void Ut_CReporterNotification::testNotificationActivated()
{
    notification = new CReporterNotification("crash-reporter", "test-summary",
                                             "test-body", "icon-test");
    // Spy activated signal from notification.
    QSignalSpy activatedSpy(notification, SIGNAL(activated()));

    // Wait for notification.
    QTest::qWait(1000);

    QVERIFY(notification->isPublished() == true);

    QString objPath(CREPORTER_DBUS_NTF_OBJECT_PATH);
    objPath.append("00000000000000000000000000000000");

    // Interact with the notification via D-Bus and block.
    QDBusMessage reply = QDBusConnection::sessionBus().call(QDBusMessage::createMethodCall(
            QDBusConnection::sessionBus().baseService(), objPath,
            CREPORTER_DBUS_NTF_INTERFACE, "activate"));

    if (reply.type() == QDBusMessage::ErrorMessage) {
        qDebug() << reply.errorMessage();
        QFAIL("Error message received from D-Bus.");
    }

    QVERIFY(activatedSpy.count() == 1);
}
开发者ID:blammit,项目名称:crash-reporter,代码行数:27,代码来源:ut_creporternotification.cpp

示例3: GetIntrospectXml

const QString PBTreeNode::GetIntrospectXml(const QDBusObjectPath &object_path)
{
    // Connect to the introspectable interface
    QDBusInterface iface(PBBusName, \
                         object_path.path(), \
                         ofDIntrospectableName, \
                         QDBusConnection::sessionBus());

    // Lets see what we have - introspect this first
    QDBusMessage reply = iface.call("Introspect");
    if (reply.type() != QDBusMessage::ReplyMessage) {
        qDebug("Could not introspect this object");
        return NULL;
    }

    QList<QVariant> args = reply.arguments();

    QList<QVariant>::iterator iter = args.begin();

    QVariant variant = *iter;

    // The introspected string describing this object
    const QString intro_xml = variant.value<QString>();

    return intro_xml;
}
开发者ID:Roadmaster,项目名称:checkbox,代码行数:26,代码来源:PBTreeNode.cpp

示例4: GetObjectProperties

QVariantMap PBTreeNode::GetObjectProperties(const QDBusObjectPath &object_path, \
                                            const QString interface)
{
    QVariantMap properties;

    // Connect to the freedesktop Properties interface
    QDBusInterface iface(PBBusName, \
                         object_path.path(), \
                         ofDPropertiesName, \
                         QDBusConnection::sessionBus());

    // GetAll properties
    QDBusMessage reply = iface.call("GetAll",interface);
    if (reply.type() != QDBusMessage::ReplyMessage) {
        // not worth complaining if they dont have properties, just return the empty
        return properties;
    }

    QList<QVariant> args = reply.arguments();

    if (args.empty()) {
        return properties;
    }

    QList<QVariant>::iterator p = args.begin();

    QVariant variant = *p;

    const QDBusArgument qda = variant.value<QDBusArgument>();

    qda >> properties;

    return properties;
}
开发者ID:Roadmaster,项目名称:checkbox,代码行数:34,代码来源:PBTreeNode.cpp

示例5: notificationClosed

void AsemanLinuxNativeNotification::notificationClosed(const QDBusMessage &dmsg)
{
    if( dmsg.type() != QDBusMessage::SignalMessage )
        return ;

    const QVariantList & args = dmsg.arguments();
    if( args.isEmpty() )
        return ;

    uint id = args.at(0).toUInt();
    if( !p->notifies.contains(id) )
        return;

    if( args.count() == 1 )
    {
        Q_EMIT notifyClosed(id);
        p->notifies.remove(id);
        return;
    }

    int type = args.at(1).toInt();
    switch (type) {
    case 1:
        Q_EMIT notifyTimedOut( id );
        break;

    case 2:
    default:
        Q_EMIT notifyClosed( id );
        p->notifies.remove(id);
        break;
    }
}
开发者ID:Aseman-Land,项目名称:aseman-qt-tools,代码行数:33,代码来源:asemanlinuxnativenotification.cpp

示例6: dumpRemovedMessage

void SHALDeviceNotifier::dumpRemovedMessage( const QDBusMessage & dmsg )
{
    if( dmsg.type() != QDBusMessage::SignalMessage )
        return ;

    QList<QVariant> list = dmsg.arguments();
    if( list.isEmpty() )
        return ;

    QString path = list.at(0).toString();

    if( p->device_list.contains(path) )
        emit this->deviceRemoved( p->device_list.take(path) );

    if( p->features_list.contains(path) )
        p->features_list.remove( path );

    if( p->disc_list.contains(path) )
    {
        SDiscFeatures disc = p->disc_list.take(path);
        p->device_to_disc.remove( disc.parent_str );

        if( p->device_list.contains( disc.parent_str ) )
            emit this->deviceDetected( p->device_list[disc.parent_str] );

        emit this->discRemoved( disc );
    }
}
开发者ID:realbardia,项目名称:silicon,代码行数:28,代码来源:shaldevicenotifier.cpp

示例7: qDebug

bool
BTAdaptor::validateBtDevice ()
{
    qDebug() << "Validating bluetooth device";
    QDBusMessage msg = QDBusMessage::createMethodCall ("org.bluez",
                                                       mAdapterPath,
                                                       "org.bluez.Adapter",
                                                       "GetProperties");
    
    QDBusMessage reply = QDBusConnection::systemBus ().call (msg);
    if (reply.type () == QDBusMessage::ErrorMessage)
    {
        qWarning() << "Error in dbus call";
        return false;
    }

    QDBusArgument arg = reply.arguments ().at (0).value<QDBusArgument>();
    if (arg.currentType () == QDBusArgument::MapType)
    {
        QMap<QString,QVariant> props = qdbus_cast<QMap<QString,QVariant> > (arg);
        
        QMap<QString,QVariant>::iterator iter;
    	for (iter = props.begin (); iter != props.end (); ++iter)
    	{
        	// ! @todo Perform some validation on the returned properties
        	qDebug() << iter.key () << ":" << iter.value ();
    	}
    }
}
开发者ID:ycyd,项目名称:buteo-sync-fw,代码行数:29,代码来源:BTAdaptor.cpp

示例8: SLOT

void
BTAdaptor::searchBtDevices ()
{
    // Connect to the signal DeviceFound to obtain the list of devices
    QDBusConnection bus = QDBusConnection::systemBus ();
    bool success = bus.connect ("org.bluez",
                                mAdapterPath,
                                "org.bluez.Adapter",
                                "DeviceFound",
                                this,
                                SLOT (deviceFound(QString,QMap<QString,QVariant>)));

    if (!success)
    {
        qDebug() << "Failure in connecting dbus signal";
        return;
    }
    
    QDBusMessage msg = QDBusMessage::createMethodCall ("org.bluez",
                                                       mAdapterPath,
                                                       "org.bluez.Adapter",
                                                       "StartDiscovery");

    QDBusMessage reply = bus.call (msg);
    if (reply.type () == QDBusMessage::ErrorMessage)
    {
        qWarning() << "Error in dbus call to search for devices";
        return ;
    }
}
开发者ID:ycyd,项目名称:buteo-sync-fw,代码行数:30,代码来源:BTAdaptor.cpp

示例9: 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

示例10: 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

示例11: cleanupTestCase

void KWalletExecuter::cleanupTestCase()
{
    QDBusMessage msg =
        QDBusMessage::createMethodCall("org.kde.kwalletd", "/MainApplication", "org.kde.KApplication", "quit");
    const QDBusMessage reply = QDBusConnection::sessionBus().call(msg);

    Q_ASSERT(reply.type() != QDBusMessage::ErrorMessage);
}
开发者ID:KDE,项目名称:kde-runtime,代码行数:8,代码来源:kwalletexecuter.cpp

示例12: initObjects

bool DbusPopupHandler::initObjects()
{
	if (!initNotifyInterface())
		return false;

	FServerInfo = new ServerInfo;

	QDBusMessage replyCaps = FNotifyInterface->call(QDBus::Block, "GetCapabilities");
	if (replyCaps.type() != QDBusMessage::ErrorMessage)
	{
		for (int i=0; i<replyCaps.arguments().at(0).toStringList().count(); i++)
			LOG_INFO(QString("Capabilities: %1").arg(replyCaps.arguments().at(0).toStringList().at(i)));
		FServerInfo->capabilities = replyCaps.arguments().at(0).toStringList();
		FAllowActions = FServerInfo->capabilities.contains("actions");
	}
	else
		LOG_WARNING(QString("Capabilities: DBus Error: %1").arg(replyCaps.errorMessage()));

	QDBusMessage replyInfo = FNotifyInterface->call(QDBus::Block, "GetServerInformation");
	if (replyInfo.type() != QDBusMessage::ErrorMessage)
	{
		for (int i=0; i<replyInfo.arguments().count(); i++)
			LOG_INFO(QString("Server Information: %1").arg(replyInfo.arguments().at(i).toString()));

		FServerInfo->name = replyInfo.arguments().at(0).toString();
		FServerInfo->vendor = replyInfo.arguments().at(1).toString();
		FServerInfo->version = replyInfo.arguments().at(2).toString();
		FServerInfo->spec_version = replyInfo.arguments().at(3).toString();

	}
	else
		LOG_WARNING(QString("Server Information: DBus Error: %1").arg(replyInfo.errorMessage()));

	if (FAllowActions)
	{
		connect(FNotifyInterface,SIGNAL(ActionInvoked(uint,QString)),this,SLOT(onActionInvoked(uint,QString)));
		connect(FNotifyInterface,SIGNAL(NotificationClosed(uint,uint)),this,SLOT(onNotificationClosed(uint,uint)));
		LOG_INFO(QLatin1String("Actions supported."));
	}
	else
		LOG_INFO(QLatin1String("Actions not supported."));

	FNotifications->insertNotificationHandler(NHO_DBUSPOPUP, this);

	return true;
}
开发者ID:Vacuum-IM,项目名称:dbusnotifications,代码行数:46,代码来源:dbuspopuphandler.cpp

示例13: gotDevices

void ColordEngine::gotDevices(const QDBusMessage &message)
{
    if (message.type() == QDBusMessage::ReplyMessage && message.arguments().size() == 1) {
        QDBusArgument argument = message.arguments().first().value<QDBusArgument>();
        ObjectPathList paths = qdbus_cast<ObjectPathList>(argument);
        foreach (const QDBusObjectPath &path, paths) {
            deviceAdded(path);
        }
开发者ID:KDE,项目名称:colord-kde,代码行数:8,代码来源:ColordEngine.cpp

示例14: 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

示例15: call

QList<QVariant> QmIPCInterface::get(const QString& method,
                                    const QVariant& arg1,
                                    const QVariant& arg2) {
    QList<QVariant> results;
    QDBusMessage msg = call(method, arg1, arg2);
    if (msg.type() == QDBusMessage::ReplyMessage) {
        results  = msg.arguments();
    }
    return results;
}
开发者ID:martyone,项目名称:lipstick,代码行数:10,代码来源:qmipcinterface.cpp


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