[Bug 76828] [next] TpClientFactory should be the top level singleton

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Apr 3 06:49:41 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=76828

--- Comment #25 from Simon McVittie <simon.mcvittie at collabora.co.uk> ---
(In reply to comment #23)
> http://cgit.freedesktop.org/~smcv/empathy/commit/?h=next-
> factory&id=7a735da21f170d75808cf32899c5322e116cc34a: You can use
> g_application_get_dbus_connection() instead of g_bus_get_sync().

"""
If GApplication is not using D-Bus then this function will return NULL. This
includes the situation where the D-Bus backend would normally be in use but we
were unable to connect to the bus.
"""

... so I don't see much advantage over g_bus_get_sync(), which returns the same
singleton if everything is OK, and can do better error signalling otherwise?

I'd be OK with swapping this if you feel that it's important though.

> You can also use HasNameOwner.

GetNameOwner requires us to check for an error. NameHasOwner requires us to
check for an error and also parse a boolean from a (b) tuple. I decided I
preferred the former :-)

> Checking on my ubuntu 14.04, unity takes
> "org.gnome.Shell" name probably for some compat. So that empathy checks
> seems wrong, but that's not a regression from your branch.

If Unity is running, the presence Indicator is just as good as the Shell's
presence widget? So in either case we don't want a GtkStatusIcon.
(Non-critical-path, in any case.)

> http://cgit.freedesktop.org/~smcv/empathy/commit/?h=next-
> factory&id=77f6895f743fd0d5d9fad7dafb327bee3753486b: the factory singleton
> is leaked then in empathy_init().

Yes, deliberately. I don't think we can fix that without adding an
empathy_uninit() or something.

> Wondering how that was working before,
> because it does unref the AM... Maybe empathy_factory_dup() should set
> itself as default if tp_client_factory_can_set_default() is true?

*shrug*

In practice I don't think it matters? The factory isn't going to be freed until
we're about to exit anyway.

> http://cgit.freedesktop.org/~smcv/telepathy-salut/commit/?h=next-
> factory&id=7b7810b5f295b4d769f96b695b2e1eae82c6b476: why do you init in each
> test instead of once in main?

A vague feeling that significant code in a GTest's main() should be avoided,
because it's executed even if all we're doing is "list test cases".

-- 
You are receiving this mail because:
You are the QA Contact for the bug.


More information about the telepathy-bugs mailing list