summaryrefslogtreecommitdiffstats
path: root/src/dbus
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-02-16 17:29:00 +0100
committerThiago Macieira <thiago.macieira@nokia.com>2010-02-16 17:30:15 +0100
commit90d398e5bef2a66ab944e1cc191c1ad6569e321a (patch)
treeabd13ed6254edf69fa8a962b4e5835ea8ca839c8 /src/dbus
parentba9857ce87d5b841f996b1c5c4246d9011e46fa3 (diff)
Fix an issue with the error signal in a callWithCallback not being
delivered queued. Since we emit the signal while the locks are in place, we have to have queued delivery. Task-number: QT-760 Reviewed-by: Trust Me
Diffstat (limited to 'src/dbus')
-rw-r--r--src/dbus/qdbusintegrator.cpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index 44abf7b740..6cb492435a 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -1937,7 +1937,7 @@ int QDBusConnectionPrivate::sendWithReplyAsync(const QDBusMessage &message, QObj
QDBusPendingCallPrivate *pcall = sendWithReplyAsync(message, timeout);
Q_ASSERT(pcall);
- // has it already finished (dispatched locally)?
+ // has it already finished with success (dispatched locally)?
if (pcall->replyMessage.type() == QDBusMessage::ReplyMessage) {
pcall->setReplyCallback(receiver, returnMethod);
processFinishedCall(pcall);
@@ -1945,33 +1945,24 @@ int QDBusConnectionPrivate::sendWithReplyAsync(const QDBusMessage &message, QObj
return 1;
}
+ // either it hasn't finished or it has finished with error
+ if (errorMethod) {
+ pcall->watcherHelper = new QDBusPendingCallWatcherHelper;
+ connect(pcall->watcherHelper, SIGNAL(error(QDBusError,QDBusMessage)), receiver, errorMethod,
+ Qt::QueuedConnection);
+ pcall->watcherHelper->moveToThread(thread());
+ }
+
// has it already finished and is an error reply message?
if (pcall->replyMessage.type() == QDBusMessage::ErrorMessage) {
- if (errorMethod) {
- pcall->watcherHelper = new QDBusPendingCallWatcherHelper;
- connect(pcall->watcherHelper, SIGNAL(error(QDBusError,QDBusMessage)), receiver, errorMethod);
- pcall->watcherHelper->moveToThread(thread());
- }
processFinishedCall(pcall);
delete pcall;
return 1;
}
- // has it already finished with error?
- if (pcall->replyMessage.type() != QDBusMessage::InvalidMessage) {
- delete pcall;
- return 0;
- }
-
pcall->autoDelete = true;
pcall->ref.ref();
-
pcall->setReplyCallback(receiver, returnMethod);
- if (errorMethod) {
- pcall->watcherHelper = new QDBusPendingCallWatcherHelper;
- connect(pcall->watcherHelper, SIGNAL(error(QDBusError,QDBusMessage)), receiver, errorMethod);
- pcall->watcherHelper->moveToThread(thread());
- }
return 1;
}