void Controller::makeCall() {
QDBusPendingCall asyncCall = connection.asyncCall(msg, timeout);
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(asyncCall, this);
QObject::connect(watcher,
SIGNAL(finished
(QDBusPendingCallWatcher
*)),
this, SLOT(callFinishedSlot(QDBusPendingCallWatcher*)));
// with this commented out, callFinishedSlot() is never called. If the comment is removed, callFinishedSlot() is called
//watcher->waitForFinished();
}
void Controller::callFinishedSlot(QDBusPendingCallWatcher *watcher) {
LOG_DEBUG("got finished");
} // callFinishedSlot()
void Controller::makeCall() {
QDBusMessage msg = QDBusMessage::createMethodCall(serviceName, objectPath, "", method);
QDBusPendingCall asyncCall = connection.asyncCall(msg, timeout);
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(asyncCall, this);
QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
this, SLOT(callFinishedSlot(QDBusPendingCallWatcher*)));
// with this commented out, callFinishedSlot() is never called. If the comment is removed, callFinishedSlot() is called
//watcher->waitForFinished();
}
void Controller::callFinishedSlot(QDBusPendingCallWatcher *watcher) {
LOG_DEBUG("got finished");
} // callFinishedSlot()
To copy to clipboard, switch view to plain text mode
Bookmarks