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 787496 - Fix Gio::Application::property_resource_base_path in 2.54 too?
Fix Gio::Application::property_resource_base_path in 2.54 too?
Status: RESOLVED FIXED
Product: glibmm
Classification: Bindings
Component: giomm
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2017-09-10 09:23 UTC by Daniel Boles
Modified: 2018-03-21 11:56 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Daniel Boles 2017-09-10 09:23:50 UTC
property_resource_base_path() had the wrong type, bool instead of std::string like the accessors.

Given that no user could have done much useful with this in any previous version, could the recent fix* be picked to glibmm-2-54 also?

I guess it's possible someone could've connected to its signal_changed(), then used get_resource_base_path() to get the real value... so maybe this leaves too much chance for an ABI break. However, maybe that's unlikely enough in reality; I have to wonder how often the value would change, and in a way needing a signal.

* https://git.gnome.org/browse/glibmm/commit/?id=66954ba29fa9c8407d998536f71f4361a330b74b
Comment 1 Kjell Ahlstedt 2017-09-12 14:50:18 UTC
I was also thinking about what can be done in glibmm-2-54 without breaking
ABI or API. This is not possible, unfortunately:

  _WRAP_PROPERTY("resource-base-path", bool, newin "2,44",
     deprecated "Use the property_resource_base_path() with type std::string")
  _WRAP_PROPERTY("resource-base-path", std::string, newin "2,54")

We can't have overloaded functions where only the return type differs.

This is not ideal, but at least it would not break anything:

  //TODO: Change bool to std::string when we can break API/ABI.
  _WRAP_PROPERTY("resource-base-path", bool, newin "2,44",
     deprecated "This property has got the wrong type. Please use
     set/get_resource_base_path()")
Comment 2 Daniel Boles 2017-09-12 17:10:40 UTC
Sure, I guess if anyone accidentally used this with the wrong return value, that's not quite justification to ABI-break them. :P It would be great to at least warn them about the problem instead.
Comment 3 Kjell Ahlstedt 2017-09-13 16:35:30 UTC
glibmm 2.54.0 has been released. Too late to deprecate
property_resource_base_path() in glibmm 2.54.x, I guess.
But I have added a note to the documentation.
https://git.gnome.org/browse/glibmm/commit/?h=glibmm-2-54&id=51258a1c1f7aa82a5ed5934f64329096cfb0e009

Shall we close this bug, or keep it open and hope that more can be done in
glibmm 2.56.x, if it will also belong to the glibmm-2.4 ABI series?
Comment 4 Daniel Boles 2017-09-13 18:20:30 UTC
Might it be possible to add e.g. property_resource_base_path_string() or some other different but inoffensive name, to retain property functionality?
Comment 5 Kjell Ahlstedt 2017-09-15 13:05:56 UTC
It's not possible with _WRAP_PROPERTY(), because its first parameter determines
both the name of the property_*() method and the name of the property in the
GType system. A manually added property_resource_base_path_string() is possible
but adding API is not allowed in the glibmm-2-54 branch now that glibmm 2.54.0
has been released.
Comment 6 Kjell Ahlstedt 2018-03-21 11:56:57 UTC
I have deprecated property_resource_base_path() and added
property_resource_base_path_string() in the glibmm-2-56 branch, which will
belong to the glibmm-2.4 ABI.