After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 621213 - GDBusProxy and well-known names
GDBusProxy and well-known names
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gdbus
unspecified
Other Linux
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-06-10 15:32 UTC by David Zeuthen (not reading bugmail)
Modified: 2010-06-11 22:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description David Zeuthen (not reading bugmail) 2010-06-10 15:32:03 UTC
Basically implement

 http://mail.gnome.org/archives/gtk-devel-list/2009-October/msg00075.html

along with test cases for this.
Comment 1 Allison Karlitskaya (desrt) 2010-06-10 15:34:02 UTC
Once we do this, I propose that there will be no use for the existing g_bus_watch_proxy() API (which in my opinion is annoying to use and racy for some use cases).
Comment 2 David Zeuthen (not reading bugmail) 2010-06-10 16:05:14 UTC
(In reply to comment #1)
> Once we do this, I propose that there will be no use for the existing
> g_bus_watch_proxy() API (which in my opinion is annoying to use and racy for
> some use cases).

I disagree. It combines getting the bus and getting a proxy (two blocking ops) into an easy-to-use API that is really hard to get wrong.

And I think adding that kind of API to GDBusProxy is a mistake and would uglify the API a lot. E.g. you are not going to get

 g_dbus_proxy_new_for_bus
 g_dbus_proxy_new_for_bus_finish
 g_dbus_proxy_new_for_bus_sync

in addition to the existing new function.
Comment 3 Allison Karlitskaya (desrt) 2010-06-10 16:14:54 UTC
On IRC I mentioned that it would be beneficial to keep the combined API for the reasons you discuss.  I suggested this API:

void         g_bus_get_proxy        (GBusType              bus_type,
                                     ...etc...,
                                     GAsyncReadyCallback   callback,
                                     gpointer              user_data);

GDBusProxy * g_bus_get_proxy_finish (GAsyncResult         *result,
                                     GError              **error);

GDBusProxy * g_bus_get_proxy_sync   (GBusType              bus_type,
                                     ...etc...,
                                     GError              **error);

it's a nice match to the existing g_bus_* APIs, particularly g_bus_get().


Forcing people to use the explicit lifecycle API instead of the nicer API you described in this email just because they want a convenient one-step construction is an odd proposition.  May as well let people use the nicer object API *and* the nice construction API.
Comment 4 David Zeuthen (not reading bugmail) 2010-06-11 22:44:32 UTC
Fixed with this commit

 http://git.gnome.org/browse/glib/commit/?id=32f2e9a85beedeea36ac7623f68f6eb878465d44