summaryrefslogtreecommitdiffstats
path: root/src/dbus
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-09-10 15:12:53 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-09-22 13:13:37 (GMT)
commit2d3836c44ac0e97b1f7301668f0241a57aff9c4a (patch)
treefd5556a594ef53681617bc7137440acdb460e7ee /src/dbus
parentad1fe7574f36dc54a1a0050308c52fc15e757842 (diff)
downloadQt-2d3836c44ac0e97b1f7301668f0241a57aff9c4a.zip
Qt-2d3836c44ac0e97b1f7301668f0241a57aff9c4a.tar.gz
Qt-2d3836c44ac0e97b1f7301668f0241a57aff9c4a.tar.bz2
Save the D-Bus's base service earlier.
It's impossible for it not to be present, so there's no need to test for it. Reviewed-By: Robin Burchell Reviewed-By: Ritt Konstantin
Diffstat (limited to 'src/dbus')
-rw-r--r--src/dbus/qdbusintegrator.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index c7b531e..3deb738 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -1661,6 +1661,10 @@ void QDBusConnectionPrivate::setConnection(DBusConnection *dbc, const QDBusError
connection = dbc;
mode = ClientMode;
+ const char *service = q_dbus_bus_get_unique_name(connection);
+ Q_ASSERT(service);
+ baseService = QString::fromUtf8(service);
+
q_dbus_connection_set_exit_on_disconnect(connection, false);
q_dbus_connection_set_watch_functions(connection, qDBusAddWatch, qDBusRemoveWatch,
qDBusToggleWatch, this, 0);
@@ -1671,7 +1675,6 @@ void QDBusConnectionPrivate::setConnection(DBusConnection *dbc, const QDBusError
// Initialize the match rules
// We want all messages that have us as destination
// signals don't have destinations, but connectSignal() takes care of them
- const char *service = q_dbus_bus_get_unique_name(connection);
if (service) {
QVarLengthArray<char, 56> filter;
filter.append("destination='", 13);
@@ -1685,7 +1688,6 @@ void QDBusConnectionPrivate::setConnection(DBusConnection *dbc, const QDBusError
return;
}
- baseService = QString::fromUtf8(service);
} else {
qWarning("QDBusConnectionPrivate::setConnection: Unable to get base service");
}