Changeset View
Changeset View
Standalone View
Standalone View
src/util/externalcommand.cpp
Show First 20 Lines • Show All 444 Lines • ▼ Show 20 Line(s) | 435 | { | |||
---|---|---|---|---|---|
445 | delete init; | 445 | delete init; | ||
446 | } | 446 | } | ||
447 | 447 | | |||
448 | quint64 ExternalCommand::getNonce(QDBusInterface& iface) | 448 | quint64 ExternalCommand::getNonce(QDBusInterface& iface) | ||
449 | { | 449 | { | ||
450 | QDBusPendingCall pcall = iface.asyncCall(QStringLiteral("getNonce")); | 450 | QDBusPendingCall pcall = iface.asyncCall(QStringLiteral("getNonce")); | ||
451 | QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pcall); | 451 | QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pcall); | ||
452 | QEventLoop loop; | 452 | QEventLoop loop; | ||
453 | unsigned long long rval = 0; | 453 | quint64 rval = 0; | ||
454 | 454 | | |||
455 | auto exitLoop = [&] (QDBusPendingCallWatcher *watcher) { | 455 | auto exitLoop = [&] (QDBusPendingCallWatcher *watcher) { | ||
456 | loop.exit(); | 456 | loop.exit(); | ||
457 | 457 | | |||
458 | if (watcher->isError()) | 458 | if (watcher->isError()) | ||
459 | qWarning() << watcher->error(); | 459 | qWarning() << watcher->error(); | ||
460 | else { | 460 | else { | ||
461 | QDBusPendingReply<unsigned long long> reply = *watcher; | 461 | QDBusPendingReply<quint64> reply = *watcher; | ||
462 | rval = reply; | 462 | rval = reply; | ||
463 | } | 463 | } | ||
464 | }; | 464 | }; | ||
465 | 465 | | |||
466 | connect(watcher, &QDBusPendingCallWatcher::finished, exitLoop); | 466 | connect(watcher, &QDBusPendingCallWatcher::finished, exitLoop); | ||
467 | loop.exec(); | 467 | loop.exec(); | ||
468 | return rval; | 468 | return rval; | ||
469 | } | 469 | } | ||
Show All 15 Lines |