GNOME Bugzilla – Bug 639478
GDBusServer's g_dbus_server_new_sync() function should just call g_initable_new()
Last modified: 2011-03-25 22:02:23 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.
I agree (should be simple to fix). Would also be nice to add the async new function.
Tristan, do you have time for this little fix?
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.
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!