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 764547 - Use conversion from GDBusProxy* to C++ object not possible outside Gio::DBus namespace.
Use conversion from GDBusProxy* to C++ object not possible outside Gio::DBus ...
Status: RESOLVED FIXED
Product: glibmm
Classification: Bindings
Component: giomm
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2016-04-03 15:32 UTC by Marcin Kolny (IRC: loganek)
Modified: 2016-04-05 17:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-Gio-DBus-Proxy-allow-using-GDBusProxy-conversion-out.patch (2.20 KB, patch)
2016-04-03 15:32 UTC, Marcin Kolny (IRC: loganek)
committed Details | Review

Description Marcin Kolny (IRC: loganek) 2016-04-03 15:32:13 UTC
Created attachment 325265 [details] [review]
0001-Gio-DBus-Proxy-allow-using-GDBusProxy-conversion-out.patch

Since in conversion definition we're removing namespaces, we're not able use the same conversion in other places.
I've fixed conversion from GDBusProxy*, so now it can be used outside Gio::DBus namespace.
I think I'm not breaking the API - probably this conversion has been used only in giomm (actually, it can be used only in Gio::DBus namespace, it's very unlikely that someone else used the same namespace and the same class name in his wrapper).

Please review, if patch looks OK, I'll push it.
Comment 1 Murray Cumming 2016-04-03 15:53:32 UTC
Sure. That looks harmless, though it doesn't seem so hard to put another conversion in your own project.
Comment 2 Marcin Kolny (IRC: loganek) 2016-04-03 17:17:12 UTC
Of course, I could add own conversion in my project (actually, I did it), but it's kind of duplicating code.
So if there are no objections, I'll push it.
Comment 3 Kjell Ahlstedt 2016-04-04 08:48:45 UTC
There are lots of such duplications. It's very common to skip the namespace
where it can be done, and add _CONVERSION()s where they are needed.

Some examples:

glibmm/tools/m4/convert_gio.m4
------------------------------
_CONVERSION(`const Glib::RefPtr<AsyncResult>&',`GAsyncResult*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`const Glib::RefPtr<MenuModel>&',`GMenuModel*',__CONVERT_CONST_REFPTR_TO_P)
_CONVERSION(`GMenuModel*',`Glib::RefPtr<MenuModel>',`Glib::wrap($3)')

gtkmm/tools/m4/convert_gtk.m4
------------------------------
_CONVERSION(`const Glib::RefPtr<Gio::AsyncResult>&',`GAsyncResult*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`const Glib::RefPtr<Gio::MenuModel>&',`GMenuModel*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`GMenuModel*',`Glib::RefPtr<Gio::MenuModel>',`Glib::wrap($3)')
Comment 4 Marcin Kolny (IRC: loganek) 2016-04-04 20:38:46 UTC
(In reply to Kjell Ahlstedt from comment #3)
> There are lots of such duplications. It's very common to skip the namespace
> where it can be done, and add _CONVERSION()s where they are needed.
So what do you suggest Should I leave it as it is, or rather fix it?
Should we use namespaces for the new conversions? I think that would be a good practice.
Comment 5 Kjell Ahlstedt 2016-04-05 08:14:36 UTC
Do as you like. I doubt that it will be a new practice to include namespaces
everywhere in all _WRAP_METHODs. But it's not consistently left out now.
For instance, Gio::DBus::Interface and Gio::DBus::Object are specified with
namespaces. If you want to do the same with Gio::DBus::Proxy, it's ok with me.
Comment 6 Marcin Kolny (IRC: loganek) 2016-04-05 17:40:38 UTC
ok, so I'm pushing my commit. Thanks.