Bug 29409

Summary: StatefulDBusProxy should use QDBusServiceWatcher, if available
Product: Telepathy Reporter: Olli Salli <ollisal>
Component: tp-qtAssignee: Andre Moreira Magalhaes <andrunko>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium Keywords: patch
Version: git master   
Hardware: All   
OS: All   
URL: http://git.collabora.co.uk/?p=user/andrunko/telepathy-qt4.git;a=shortlog;h=refs/heads/dbus-proxy-qdbusservicewatcher-support
Whiteboard: review-, minor changes
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.