diff options
author | Daniel Boles <dboles@src.gnome.org> | 2020-06-03 08:39:47 +0100 |
---|---|---|
committer | Daniel Boles <dboles@src.gnome.org> | 2020-06-03 08:40:56 +0100 |
commit | 4f1e7af1ffc1a67f6da1795e5061c6a4840b7633 (patch) | |
tree | 5a00d12192a5a80d301052450869730e441be5de /glib | |
parent | 72a19fe0ad28a5f3643d3ed26a58179330f49d0c (diff) | |
download | glibmm-4f1e7af1ffc1a67f6da1795e5061c6a4840b7633.tar.gz |
propertyproxy_base: Fix using notify w/o prop name
GLib has now specified that if you want to connect to a signal without a
detail argument, you omit the `::`. So, glibmm users previously
connecting to `notify::` to listen for changes to all properties broke.
Fix that by only passing `notify` i.e. no superfluous `::` in that case.
Close https://gitlab.gnome.org/GNOME/glibmm/-/issues/74
Close https://gitlab.gnome.org/GNOME/glibmm/-/merge_requests/35
Diffstat (limited to 'glib')
-rw-r--r-- | glib/glibmm/propertyproxy_base.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/glib/glibmm/propertyproxy_base.cc b/glib/glibmm/propertyproxy_base.cc index d473c63e..bc643498 100644 --- a/glib/glibmm/propertyproxy_base.cc +++ b/glib/glibmm/propertyproxy_base.cc @@ -39,12 +39,21 @@ PropertyProxyConnectionNode::PropertyProxyConnectionNode(sigc::slot_base&& slot, { } +static Glib::ustring +get_detailed_signal_name(const Glib::ustring& signal_name, const Glib::ustring& detail) +{ + if (detail.empty()) + return signal_name; + + return signal_name + "::" + detail; +} + sigc::connection PropertyProxyConnectionNode::connect_changed(const Glib::ustring& property_name) { // connect it to glib // 'this' will be passed as the data argument to the callback. - const Glib::ustring notify_signal_name = "notify::" + property_name; + const Glib::ustring notify_signal_name = get_detailed_signal_name("notify", property_name); connection_id_ = g_signal_connect_data(object_, notify_signal_name.c_str(), (GCallback)(&PropertyProxyConnectionNode::callback), this, &PropertyProxyConnectionNode::destroy_notify_handler, G_CONNECT_AFTER); |