GNOME Bugzilla – Bug 787496
Fix Gio::Application::property_resource_base_path in 2.54 too?
Last modified: 2018-03-21 11:56:57 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
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()")
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.
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?
Might it be possible to add e.g. property_resource_base_path_string() or some other different but inoffensive name, to retain property functionality?
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.
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.