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 774903 - glibmm-2.4: Wrap missing methods in Gio::SettingsSchemaKey?
glibmm-2.4: Wrap missing methods in Gio::SettingsSchemaKey?
Status: RESOLVED FIXED
Product: glibmm
Classification: Bindings
Component: giomm
2.50.x
Other All
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2016-11-23 11:07 UTC by Daniel Boles
Modified: 2017-05-04 12:58 UTC
See Also:
GNOME target: ---
GNOME version: 3.21/3.22


Attachments
[PATCH] SettingsSchemaKey: Wrap missing methods (1.94 KB, patch)
2016-12-01 02:30 UTC, Daniel Boles
none Details | Review

Description Daniel Boles 2016-11-23 11:07:04 UTC
settingsschemakey.hg has the following TODOs:

>  //TODO: _WRAP_METHOD(const GVariantType *    g_settings_schema_key_get_value_type           (), g_settings_schema_key_get_value_type)
>  //_WRAP_METHOD(GVariant *              g_settings_schema_key_get_default_value        (), g_settings_schema_key_get_default_value)
>  //_WRAP_METHOD(GVariant *              g_settings_schema_key_get_range                (), g_settings_schema_key_get_range)
>  //TODO: _WRAP_METHOD(bool range_check(GVariant               *value), g_settings_schema_key_range_check)

These should be wrapped as (despite the warnings about 'this should probably not be used') it is really convenient to be able to iterate over a schema and build controls for it dynamically, e.g. for a preferences dialog. There are presumably other, less discouraged use cases too, but the former was the one I have at the moment. But for now we can only get the names and descriptions.

I started looking at this but got stuck on the first one, as it seems GVariantType has no implicit conversion to its glibmm counterpart - but I'm not up to speed on how the wrapping really works yet, so I don't know whether this is a real problem.

I didn't yet continue and try the others, but I guess they should work, as I've seen similar functions being wrapped with the basic macro and working OK.
Comment 1 Daniel Boles 2016-12-01 02:30:47 UTC
Created attachment 341103 [details] [review]
[PATCH] SettingsSchemaKey: Wrap missing methods

This makes perfect sense and builds fine, but I've not tested it yet.
Comment 2 Kjell Ahlstedt 2016-12-05 16:14:34 UTC
Your patch looks fine. If you've got write permission to the git repository,
you can push it. If not, I can do it.

It should definitely be pushed to the master branch.

Murray, is this also something for the glibmm-2-50 branch?

Usually we don't add API to a stable branch after the x.y.0 version has been
released, but I've a feeling that this rule is not absolute for glibmm-2-50
and gtkmm-3-22, which are supposed to be the last branches of glibmm-2.4 and
gtkmm-3.0, respectively.
Comment 3 Daniel Boles 2016-12-05 18:55:48 UTC
Thanks! I've pushed to master. I'd really appreciate if this could hit 2.50 too.
Comment 4 Murray Cumming 2016-12-06 12:25:27 UTC
For now, I'd prefer to avoid adding API to the stable branch of either glibmm or gtkmm, and I feel uncomfortable deprecating API in stable GTK+ too. But we should track what glib and gtk+ do. I can't imagine that there will be no new API in GTK+ 3, but I do guess that they will eventually do that in a proper minor release, as before.

Maybe we'll end up doing another stable glibmm-2.4 2.52 and changing glibmm-2-52 to glibmm-2-54. But at some point we have to stop adding API to glibmm-2.4.

So, feel free to keep this open for now, in case we want to add this to glibmm-2.4 later.
Comment 5 Daniel Boles 2016-12-06 15:05:46 UTC
I understand your concerns. But if we were tracking GLib, then these keys should already have already existed long ago, since they are GLIB_AVAILABLE_IN_2_40. :) I think of patches like this as bugfixes rather than new API, and they don't pose any risk to existing users - quite the opposite by making the class far more useful.
Comment 6 Murray Cumming 2016-12-07 10:29:05 UTC
Our policy, and GNOME's policy, is not to add API in stable releases. That way you don't have a huge number of possible versions to worry about when you think about what version you need to depend on.
Comment 7 Daniel Boles 2017-05-04 09:56:48 UTC
Following on from the discussion about glibmm-2-52 being stable but API-modifying, could this be included in that release? Thanks.
Comment 8 Murray Cumming 2017-05-04 12:58:59 UTC
Push to the glibmm-2-52 branch, which I will release a stable version of soon:
https://git.gnome.org/browse/glibmm/commit/?h=glibmm-2-52&id=4e9c04cafc37921652e69e6dee741cf0cac31a17

Thanks.