本文整理汇总了C++中QDBusMessage::errorMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ QDBusMessage::errorMessage方法的具体用法?C++ QDBusMessage::errorMessage怎么用?C++ QDBusMessage::errorMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDBusMessage
的用法示例。
在下文中一共展示了QDBusMessage::errorMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: useSkype
void IMQDBus::useSkype()
{
QDBusMessage msg = QDBusMessage::createMethodCall ( "com.Skype.API", "/com/Skype", "com.Skype.API", "Invoke" );
QList<QVariant> args;
args.append ( QVariant ( QString ( "NAME Choqok" ) ) );
msg.setArguments ( args );
QDBusMessage rep = QDBusConnection::sessionBus().call ( msg );
if ( rep.type() == QDBusMessage::ErrorMessage ) {
qDebug() << "ERROR" << rep.errorMessage();
return;
}
args.clear();
args.append ( QVariant ( QString ( "PROTOCOL 7" ) ) );
msg.setArguments ( args );
rep = QDBusConnection::sessionBus().call ( msg );
if ( rep.type() == QDBusMessage::ErrorMessage ) {
qDebug() << "ERROR" << rep.errorMessage();
return;
}
args.clear();
args.append ( QVariant ( QString ( "SET PROFILE MOOD_TEXT %1" ).arg ( m_statusMsg ) ) );
msg.setArguments ( args );
rep = QDBusConnection::sessionBus().call ( msg );
if ( rep.type() == QDBusMessage::ErrorMessage ) {
qDebug() << "ERROR" << rep.errorMessage();
return;
}
}
示例2: triggerWarningAlarm
void MainWindow::triggerWarningAlarm() {
clearAlarm();
m_belowAlarmTime = true;
if (m_useLED) {
qDebug() << "alarm time";
#ifdef IS_MAEMO
QDBusMessage reply;
// set the LED pattern
reply = m_dbusInterface->call(MCE_ACTIVATE_LED_PATTERN, "PatternError");
if (reply.type() == QDBusMessage::ErrorMessage)
qDebug() << reply.errorMessage();
// turn on the display too
reply = m_dbusInterface->call(MCE_DISPLAY_ON_REQ, 1);
if (reply.type() == QDBusMessage::ErrorMessage)
qDebug() << reply.errorMessage();
#endif
}
if (m_useSounds) {
qDebug() << "playing sound";
m_warningFile.setFileName(DATADIR "/agenda/sounds/KDE_NotifySm.wav");
m_warningFile.open(QIODevice::ReadOnly);
m_audioOut->reset();
m_audioOut->start(&m_warningFile);
}
}
示例3: 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);
}
示例4: printDBusMsg
/************************************************
Helper func
************************************************/
void printDBusMsg(const QDBusMessage &msg)
{
qWarning() << "** Dbus error **************************";
qWarning() << "Error name " << msg.errorName();
qWarning() << "Error msg " << msg.errorMessage();
qWarning() << "****************************************";
}
示例5: disconnectDevice
void NetworkDevice::disconnectDevice()
{
QDBusMessage query = m_networkDeviceInterface->call("Disconnect");
if(query.type() != QDBusMessage::ReplyMessage)
qCWarning(dcNetworkManager()) << query.errorName() << query.errorMessage();
}
示例6: 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";
}
示例7: 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;
}
示例8: 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();
}
示例9: info
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow), m_timer(), m_totalNeededTime(0,0), m_spentTime(0,0), m_belowAlarmTime(false), m_belowEndTime(false),
m_dbusInterface(0), m_alarmTime(60), m_useLED(true), m_useSounds(true)
{
ui->setupUi(this);
m_topics.push_back(new AgendaTopic("topic #1", QTime(0,5)));
m_topics.push_back(new AgendaTopic("topic #2", QTime(0,15)));
calculateTotalTimes();
m_currentTopic = 1;
mainWindowSetup();
setupMenus();
connect(ui->next, SIGNAL(clicked()), this, SLOT(switchToNextTopic()));
connect(ui->previous, SIGNAL(clicked()), this, SLOT(switchToPreviousTopic()));
connect(ui->start, SIGNAL(clicked()), this, SLOT(startOrStop()));
connect(ui->plus15, SIGNAL(clicked()), this, SLOT(add15m()));
connect(ui->plus5, SIGNAL(clicked()), this, SLOT(add5m()));
connect(ui->plus1, SIGNAL(clicked()), this, SLOT(add1m()));
connect(ui->minus15, SIGNAL(clicked()), this, SLOT(minus15m()));
connect(ui->minus5, SIGNAL(clicked()), this, SLOT(minus5m()));
connect(ui->minus1, SIGNAL(clicked()), this, SLOT(minus1m()));
connect(&m_timer, SIGNAL(timeout()), this, SLOT(timeElapsed()));
#ifdef IS_MAEMO
m_dbusInterface = new QDBusInterface(MCE_SERVICE, MCE_REQUEST_PATH, MCE_REQUEST_IF, QDBusConnection::systemBus(), this);
QDBusMessage reply = m_dbusInterface->call(MCE_ENABLE_LED);
if (reply.type() == QDBusMessage::ErrorMessage)
qDebug() << reply.errorMessage();
#endif
// set up the output audio
QAudioFormat format;
// Set up the format, eg.
format.setFrequency(44100);
format.setChannels(1);
format.setSampleSize(16);
format.setCodec("audio/pcm");
format.setByteOrder(QAudioFormat::LittleEndian);
format.setSampleType(QAudioFormat::SignedInt);
QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice());
m_audioOut = new QAudioOutput(format);
// connect(m_audioOut,SIGNAL(stateChanged(QAudio::State)),SLOT(finishedPlaying(QAudio::State)));
}
示例10: _call_ret
QVariant ModeControlEntity::_call_ret(const QString req) const
{
if (!m_iface) {
return QVariant();
}
QDBusMessage m = m_iface->call(req);
if (m.type() == QDBusMessage::ErrorMessage || m.arguments().count() == 0) {
qWarning() << "Could not get activity state:" << m.errorMessage();
return QVariant();
}
return m.arguments().first();
}
示例11: useKopete
void IMQDBus::useKopete()
{
QDBusMessage msg = QDBusMessage::createMethodCall ( "org.kde.kopete", "/Kopete", "org.kde.Kopete", "setStatusMessage" );
QList<QVariant> args;
args.append ( QVariant ( m_statusMsg ) );
msg.setArguments ( args );
QDBusMessage rep = QDBusConnection::sessionBus().call ( msg );
if ( rep.type() == QDBusMessage::ErrorMessage ) {
qDebug() << "ERROR" << rep.errorMessage();
return;
}
}
示例12: getSensorTypeForZone
int ThermaldInterface::getSensorTypeForZone(uint zone, uint index, QString &sensor_type)
{
QDBusMessage result;
result = iface->call("GetZoneSensorAtIndex", zone, index);
if (result.type() == QDBusMessage::ReplyMessage) {
sensor_type = result.arguments().at(0).toString();
return 0;
} else {
qCritical() << "error from" << iface->interface() << result.errorMessage();
return -1;
}
}
示例13: usePsi
void IMQDBus::usePsi()
{
QDBusMessage msg = QDBusMessage::createMethodCall ( "org.psi-im.Psi", "/Main", "org.psi_im.Psi.Main", "setStatus" );
QList<QVariant> args;
args.append ( QVariant ( "online" ) );
args.append ( QVariant ( m_statusMsg ) );
msg.setArguments ( args );
QDBusMessage rep = QDBusConnection::sessionBus().call ( msg );
if ( rep.type() == QDBusMessage::ErrorMessage ) {
qDebug() << "ERROR" << rep.errorMessage();
return;
}
}
示例14: 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();
}
示例15: getZoneInformation
int ThermaldInterface::getZoneInformation(uint index, zoneInformationType &info)
{
QDBusMessage result;
result = iface->call("GetZoneInformation", index);
if (result.type() == QDBusMessage::ReplyMessage) {
info.name = result.arguments().at(0).toString();
info.sensor_count = result.arguments().at(1).toInt();
info.trip_count = result.arguments().at(2).toInt();
return 0;
} else {
qCritical() << "error from" << iface->interface() << result.errorMessage();
return -1;
}
}