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 743939 - Add G_DECLARE_INTERFACE
Add G_DECLARE_INTERFACE
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gobject
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-02-03 15:39 UTC by Xavier Claessens
Modified: 2015-02-06 11:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add G_DECLARE_INTERFACE (4.21 KB, patch)
2015-02-03 15:40 UTC, Xavier Claessens
none Details | Review
GListModel: Use G_DECLARE_INTERFACE (1.43 KB, patch)
2015-02-03 15:40 UTC, Xavier Claessens
none Details | Review
Add G_DECLARE_INTERFACE (4.65 KB, patch)
2015-02-03 16:38 UTC, Xavier Claessens
none Details | Review
GListModel: Use G_DECLARE_INTERFACE (2.12 KB, patch)
2015-02-03 16:38 UTC, Xavier Claessens
committed Details | Review
Add G_DECLARE_INTERFACE (4.76 KB, patch)
2015-02-04 03:29 UTC, Xavier Claessens
committed Details | Review

Description Xavier Claessens 2015-02-03 15:39:29 UTC
Would be nice to simplify interfaces as well.
Comment 1 Xavier Claessens 2015-02-03 15:40:56 UTC
Created attachment 296035 [details] [review]
Add G_DECLARE_INTERFACE
Comment 2 Xavier Claessens 2015-02-03 15:40:59 UTC
Created attachment 296036 [details] [review]
GListModel: Use G_DECLARE_INTERFACE
Comment 3 Xavier Claessens 2015-02-03 15:41:25 UTC
It's missing the g_auto stuff, not sure how they work.
Comment 4 Allison Karlitskaya (desrt) 2015-02-03 15:49:14 UTC
Thanks for the patch.

In short, we need to add a 'GObject' parameter to the macro so that we can use _GLIB_DEFINE_AUTOPTR_CHAINUP().

It's sort of annoying that we have to do this, but this is sort of the reason that interfaces have pre-reqs.

On the bright side, this makes G_DECLARE_INTERFACE look just the same as G_DECLARE_*_TYPE.
Comment 5 Xavier Claessens 2015-02-03 16:38:14 UTC
Created attachment 296040 [details] [review]
Add G_DECLARE_INTERFACE
Comment 6 Xavier Claessens 2015-02-03 16:38:19 UTC
Created attachment 296041 [details] [review]
GListModel: Use G_DECLARE_INTERFACE
Comment 7 Xavier Claessens 2015-02-04 03:29:03 UTC
Created attachment 296062 [details] [review]
Add G_DECLARE_INTERFACE
Comment 8 Xavier Claessens 2015-02-05 19:49:09 UTC
Code pushed as wip/xclaesse/declare-iface
Comment 9 Allison Karlitskaya (desrt) 2015-02-06 11:22:19 UTC
Attachment 296041 [details] pushed as b553841 - GListModel: Use G_DECLARE_INTERFACE
Attachment 296062 [details] pushed as 3d39b8e - Add G_DECLARE_INTERFACE

Was perfect as-is, so pushed.

I particularly like this line in the patch :)

  -G_DEFINE_AUTOPTR_CLEANUP_FUNC(GListModel, g_object_unref)

Thanks very much.