[glibmm/glibmm-2-52] Gio::ActionMap: Fix add_action_with_parameter()
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm/glibmm-2-52] Gio::ActionMap: Fix add_action_with_parameter()
- Date: Thu, 4 May 2017 13:12:58 +0000 (UTC)
commit 19ea8885ef17743c7c6e436e770b3b3835ca5016
Author: Daniel Boles <dboles src gnome org>
Date: Sat Dec 24 14:58:38 2016 +0000
Gio::ActionMap: Fix add_action_with_parameter()
It was not registering the parameter type for the action on create, so
when activating the action later and passing a parameter, an assertion
failed about the expected and passed parameter types/counts not matching
and the parameter was not usable.
https://bugzilla.gnome.org/show_bug.cgi?id=774444
gio/src/actionmap.ccg | 4 ++--
gio/src/actionmap.hg | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gio/src/actionmap.ccg b/gio/src/actionmap.ccg
index da803bb..054eee3 100644
--- a/gio/src/actionmap.ccg
+++ b/gio/src/actionmap.ccg
@@ -33,9 +33,9 @@ ActionMap::add_action(const Glib::ustring& name)
Glib::RefPtr<SimpleAction>
ActionMap::add_action_with_parameter(
- const Glib::ustring& name, const ActivateWithParameterSlot& slot)
+ const Glib::ustring& name, const ActivateWithParameterSlot& slot, const Glib::VariantType& parameter_type)
{
- auto action = add_action(name);
+ auto action = SimpleAction::create(name, parameter_type);
action->signal_activate().connect(slot);
return action;
}
diff --git a/gio/src/actionmap.hg b/gio/src/actionmap.hg
index 6e59a62..e42d592 100644
--- a/gio/src/actionmap.hg
+++ b/gio/src/actionmap.hg
@@ -79,7 +79,7 @@ public:
* @param slot The callback method to be called when the action is activated.
* @return The Action.
*/
- Glib::RefPtr<SimpleAction> add_action_with_parameter(const Glib::ustring& name, const
ActivateWithParameterSlot& slot);
+ Glib::RefPtr<SimpleAction> add_action_with_parameter(const Glib::ustring& name, const
ActivateWithParameterSlot& slot, const Glib::VariantType& parameter_type);
_IGNORE(g_action_map_add_action_entries)
/** A Slot to be called when an action has been activated,
@@ -96,6 +96,7 @@ public:
*
* @param name The name of the Action.
* @param slot The callback method to be called when the action is activated.
+ * @parameter_type The type of parameter to be passed to the slot.
* @return The Action.
*/
Glib::RefPtr<SimpleAction> add_action(const Glib::ustring& name, const ActivateSlot& slot);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]