summaryrefslogtreecommitdiff
path: root/qt
diff options
context:
space:
mode:
authorThiago Macieira <thiago@kde.org>2006-06-12 09:18:45 +0000
committerThiago Macieira <thiago@kde.org>2006-06-12 09:18:45 +0000
commit1afe0339cfaf57af72b01ae3600ef22e437a4922 (patch)
tree7ebcaf700bc8b9331c020f98e3e50301127c4c8f /qt
parentddb936d99b382ea1108be251a27668b3e3a6359a (diff)
* qt/src/qdbusintegrator.cpp: Fix bug in parsing async methods
that took a QDBusMessage parameter. * qt/src/qdbusbus.h: Add a default flag for RequestName. * qt/tools/dbus.cpp: Don't use automatic call because we might be calling an async method: request a reply.
Diffstat (limited to 'qt')
-rw-r--r--qt/src/qdbusbus.h3
-rw-r--r--qt/src/qdbusintegrator.cpp2
-rw-r--r--qt/tools/dbus.cpp2
3 files changed, 4 insertions, 3 deletions
diff --git a/qt/src/qdbusbus.h b/qt/src/qdbusbus.h
index 1f695798..0240e65f 100644
--- a/qt/src/qdbusbus.h
+++ b/qt/src/qdbusbus.h
@@ -58,6 +58,7 @@ public:
// taken out of http://dbus.freedesktop.org/doc/dbus-specification.html
// update if the standard updates
enum RequestNameOption {
+ QueueName = 0x0,
AllowReplacingName = 0x1,
ReplaceExistingName = 0x2,
DoNotQueueName = 0x4
@@ -127,7 +128,7 @@ public Q_SLOTS:
{ return GetNameOwner(name); }
QDBusReply<ReleaseNameReply> releaseName(const QString &serviceName)
{ return ReleaseName(serviceName); }
- QDBusReply<RequestNameReply> requestName(const QString &serviceName, RequestNameOptions flags)
+ QDBusReply<RequestNameReply> requestName(const QString &serviceName, RequestNameOptions flags = QueueName)
{ return RequestName(serviceName, flags); }
QDBusReply<QStringList> listQueuedOwners(const QString &serviceName)
{ return ListQueuedOwners(serviceName); }
diff --git a/qt/src/qdbusintegrator.cpp b/qt/src/qdbusintegrator.cpp
index de012c19..509e110f 100644
--- a/qt/src/qdbusintegrator.cpp
+++ b/qt/src/qdbusintegrator.cpp
@@ -413,7 +413,7 @@ static int findSlot(const QMetaObject *mo, const QByteArray &name, int flags,
continue; // we didn't match them all
// consistency check:
- if (isAsync && metaTypes.count() > i + 1)
+ if (isAsync && metaTypes.count() > i + 1 + (hasMessage ? 1 : 0))
continue;
if (hasMessage && (mm.attributes() & attributeMask) != attributeMask)
diff --git a/qt/tools/dbus.cpp b/qt/tools/dbus.cpp
index b2556ef8..f628db95 100644
--- a/qt/tools/dbus.cpp
+++ b/qt/tools/dbus.cpp
@@ -237,7 +237,7 @@ void placeCall(const QString &service, const QString &path, const QString &inter
exit(1);
}
- QDBusMessage reply = iface->callWithArgs(member, params);
+ QDBusMessage reply = iface->callWithArgs(member, params, QDBusInterface::NoUseEventLoop);
if (reply.type() == QDBusMessage::ErrorMessage) {
QDBusError err = reply;
printf("Error: %s\n%s\n", qPrintable(err.name()), qPrintable(err.message()));