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 639478 - GDBusServer's g_dbus_server_new_sync() function should just call g_initable_new()
GDBusServer's g_dbus_server_new_sync() function should just call g_initable_n...
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: 2011-01-13 22:58 UTC by José Alburquerque
Modified: 2011-03-25 22:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
dont do anything except g_initable_new() in g_dbus_server_new_sync() (1.53 KB, patch)
2011-02-24 20:53 UTC, Tristan Van Berkom
none Details | Review

Description José Alburquerque 2011-01-13 22:58:52 UTC
It'd be nice if the GDBusServer's g_dbus_server_new_sync() function would not do more than calling g_initable_new() as is done with GDBusConnection and GDBusProxy.  This would make it easier for the C++ bindings (glibmm) to create objects using C++ constructors as is normally done.
Comment 1 David Zeuthen (not reading bugmail) 2011-01-21 18:12:27 UTC
I agree (should be simple to fix). Would also be nice to add the async new function.
Comment 2 Murray Cumming 2011-02-15 10:01:45 UTC
Tristan, do you have time for this little fix?
Comment 3 Tristan Van Berkom 2011-02-24 20:53:15 UTC
Created attachment 181870 [details] [review]
dont do anything except g_initable_new() in g_dbus_server_new_sync()

This patch moves the additional work from g_dbus_server_new_sync()
to the initable implementation instead.

It's pretty simple and I'm quite sure it's correct, however I've never
played with the initable stuff before.

I'm also not sure that the gdbusserver is following the initable rules 
to the letter... I.e. the docs for g_initable_init() say:

 * Implementations of this method must be idempotent, i.e. multiple calls
 * to this function with the same argument should return the same results.
 * Only the first call initializes the object, further calls return the result
 * of the first call. This is so that its safe to implement the singleton
 * pattern in the GObject constructor function.

Anyway, a quick review for this simple patch from people better acquainted 
with GInitable/GDbus would be good.
Comment 4 David Zeuthen (not reading bugmail) 2011-03-25 22:02:23 UTC
Repasting comments that were lost in the outage

--- Comment #4 from Murray Cumming <murrayc@murrayc.com> 2011-03-24 09:30:43 UTC ---
David, does that look good?

--- Comment #5 from David Zeuthen <zeuthen@gmail.com> 2011-03-24 13:40:26 UTC ---
(In reply to comment #4)
> David, does that look good?

I'll look at it today. Sorry for being slow.

--- Comment #6 from David Zeuthen <zeuthen@gmail.com> 2011-03-24 14:10:51 UTC ---
Committed as

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

In the future, please use git-format-patch(1) to generate the patch so it has
author, subject and commit message included. Thanks!