Bug 29409 - StatefulDBusProxy should use QDBusServiceWatcher, if available
Summary: StatefulDBusProxy should use QDBusServiceWatcher, if available
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-qt (show other bugs)
Version: git master
Hardware: All All
: medium normal
Assignee: Andre Moreira Magalhaes
QA Contact: Telepathy bugs list
URL: http://git.collabora.co.uk/?p=user/an...
Whiteboard: review-, minor changes
Keywords: patch
Depends on:
Reported: 2010-08-05 07:44 UTC by Olli Salli
Modified: 2010-09-10 02:56 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Description Olli Salli 2010-08-05 07:44:27 UTC
StatefulDBusProxy (used by the high-level proxy objects for all stateful service interfaces in tp-qt4) currently connects to the DBus daemon's serviceOwnerChanged signal in a generic way, causing a wakeup and extra processing for every StatefulDBusProxy-derived object in a tp-qt4 application whenever a DBus client enters/exits the bus or registers a well-known name.

Qt 4.6 added the QDBusServiceWatcher class (http://doc.qt.nokia.com/4.6/qdbusservicewatcher.html), which should be used to listen only for the specific name the proxy object is associated with, preventing wakeups from unrelated name changes.
Comment 1 Andre Moreira Magalhaes 2010-08-27 07:31:30 UTC
Patch attached.
Comment 2 Simon McVittie 2010-09-01 02:55:18 UTC
Major: please preserve the code order so you connect to the signal before calling the method, to not race.

Minor: in configure.ac, I'd prefer to add an AC_MSG_CHECKING...AC_MSG_RESULT pair, so we get:

    checking for QDBusServiceWatcher... yes

in buildbot logs. You can either check for it like you did, or via a pkg-config check for QtDBus >= 4.6.n, whichever's easier for you.

If you check for the functionality rather than the version, please also add a comment saying "delete this check when we depend on Qt >= 4.6.0" (replace version as appropriate).
Comment 3 Olli Salli 2010-09-10 02:56:14 UTC
Fix merged to master. Will be in 0.3.9.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.