本文整理汇总了C++中QDBusPendingReply::reply方法的典型用法代码示例。如果您正苦于以下问题:C++ QDBusPendingReply::reply方法的具体用法?C++ QDBusPendingReply::reply怎么用?C++ QDBusPendingReply::reply使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDBusPendingReply
的用法示例。
在下文中一共展示了QDBusPendingReply::reply方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getUnit
Unit::Ptr SystemdPrivate::getUnit(const QString &name)
{
Unit::Ptr unit;
QDBusPendingReply<QDBusObjectPath> reply = isdface.GetUnit(name);
reply.waitForFinished();
if (reply.isError()) {
qDebug() << reply.error().message();
} else if (! reply.reply().arguments().isEmpty()) {
QString unitPath = qdbus_cast<QDBusObjectPath>(reply.reply().arguments().first()).path();
unit = Unit::Ptr(new Unit(unitPath), &QObject::deleteLater);
}
return unit;
}
示例2: getJob
Job::Ptr SystemdPrivate::getJob(const uint id)
{
Job::Ptr job;
QDBusPendingReply<QDBusObjectPath> reply = isdface.GetJob(id);
reply.waitForFinished();
if (reply.isError()) {
qDebug() << reply.error().message();
} else if (! reply.reply().arguments().isEmpty()) {
QString jobPath = qdbus_cast<QDBusObjectPath>(reply.reply().arguments().first()).path();
job = Job::Ptr(new Job(jobPath), &QObject::deleteLater);
}
return job;
}
示例3: sessionStarted
void QBluetoothTransferReplyBluez::sessionStarted(QDBusPendingCallWatcher *watcher)
{
QDBusPendingReply<QDBusObjectPath, QVariantMap> reply = *watcher;
if (reply.isError()) {
qCWarning(QT_BT_BLUEZ) << "Failed to start obex session:"
<< reply.error().name() << reply.reply().errorMessage();
m_errorStr = QBluetoothTransferReply::tr("Push session cannot be started");
m_error = QBluetoothTransferReply::SessionError;
m_finished = true;
m_running = false;
cleanupSession();
emit QBluetoothTransferReply::error(m_error);
emit finished(this);
watcher->deleteLater();
return;
}
const QDBusObjectPath path = reply.argumentAt<0>();
const QVariantMap map = reply.argumentAt<1>();
m_transfer_path = path.path();
//watch the transfer
OrgFreedesktopDBusPropertiesInterface *properties = new OrgFreedesktopDBusPropertiesInterface(
QStringLiteral("org.bluez.obex"), path.path(),
QDBusConnection::sessionBus(), this);
connect(properties, SIGNAL(PropertiesChanged(QString,QVariantMap,QStringList)),
SLOT(sessionChanged(QString,QVariantMap,QStringList)));
watcher->deleteLater();
}
示例4: sessionCreated
void QBluetoothTransferReplyBluez::sessionCreated(QDBusPendingCallWatcher *watcher)
{
QDBusPendingReply<QDBusObjectPath> reply = *watcher;
if (reply.isError()) {
qCWarning(QT_BT_BLUEZ) << "Failed to create obex session:"
<< reply.error().name() << reply.reply().errorMessage();
m_errorStr = QBluetoothTransferReply::tr("Invalid target address");
m_error = QBluetoothTransferReply::HostNotFoundError;
m_finished = true;
m_running = false;
emit QBluetoothTransferReply::error(m_error);
emit finished(this);
watcher->deleteLater();
return;
}
m_objectPushBluez = new OrgBluezObexObjectPush1Interface(QStringLiteral("org.bluez.obex"),
reply.value().path(),
QDBusConnection::sessionBus(), this);
QDBusPendingReply<QDBusObjectPath, QVariantMap> newReply = m_objectPushBluez->SendFile(fileToTranser);
QDBusPendingCallWatcher *newWatcher = new QDBusPendingCallWatcher(newReply, this);
connect(newWatcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
SLOT(sessionStarted(QDBusPendingCallWatcher*)));
watcher->deleteLater();
}
示例5: getUnitFileState
QString SystemdPrivate::getUnitFileState(const QString& file)
{
QDBusPendingReply<QString> reply = isdface.GetUnitFileState(file);
reply.waitForFinished();
if (reply.isError()) {
qDebug() << reply.error().message();
}
return qdbus_cast<QString>(reply.reply().arguments().first());
}
示例6: QString
QString Systemd::SystemdPrivate::getUnit(const QString &name)
{
QDBusPendingReply<QDBusObjectPath> reply = isdface.GetUnit(name);
reply.waitForFinished();
if (reply.isError()) {
qDebug() << reply.error().message();
return QString();
}
return qdbus_cast<QDBusObjectPath>(reply.reply().arguments().first()).path();
}
示例7: qDebug
QList<Systemd::Job*> Systemd::SystemdPrivate::listJobs()
{
qDBusRegisterMetaType<ManagerDBusJob>();
qDBusRegisterMetaType<ManagerDBusJobList>();
QDBusPendingReply<ManagerDBusJobList> reply = isdface.ListJobs();
reply.waitForFinished();
if (reply.isError()) {
qDebug() << reply.error().message();
return QList<Systemd::Job*>();
}
QList<Systemd::Job*> queued;
const QDBusMessage message = reply.reply();
if (message.type() == QDBusMessage::ReplyMessage) {
const ManagerDBusJobList jobs = qdbus_cast<ManagerDBusJobList>(message.arguments().first());
Q_FOREACH(const ManagerDBusJob job, jobs) {
queued.append(new Systemd::Job(job.path.path()));
}
}
示例8: qDebug
QList<Job::Ptr> SystemdPrivate::listJobs()
{
QList<Job::Ptr> jobs;
qDBusRegisterMetaType<ManagerDBusJob>();
qDBusRegisterMetaType<ManagerDBusJobList>();
QDBusPendingReply<ManagerDBusJobList> reply = isdface.ListJobs();
reply.waitForFinished();
if (reply.isError()) {
qDebug() << reply.error().message();
} else {
const QDBusMessage message = reply.reply();
if (message.type() == QDBusMessage::ReplyMessage) {
const ManagerDBusJobList queued = qdbus_cast<ManagerDBusJobList>(message.arguments().first());
Q_FOREACH(const ManagerDBusJob job, queued) {
jobs.append(Job::Ptr(new Job(job.path.path()), &QObject::deleteLater));
}
}
}