[glibmm/glibmm-2-52] ActionMap: Add back add_action_with_parameter() without parameter_type.



commit ef4256e67dd3c9c02af62ae914627997a6a21bf6
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu May 4 15:25:48 2017 +0200

    ActionMap: Add back add_action_with_parameter() without parameter_type.
    
    To avoid breaking ABI due to this commit that added a parameter:
    https://git.gnome.org/browse/glibmm/commit/?h=glibmm-2-52&id=19ea8885ef17743c7c6e436e770b3b3835ca5016
    Bug #774444

 gio/src/actionmap.ccg |   11 +++++++++++
 gio/src/actionmap.hg  |   14 ++++++++++++++
 2 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/gio/src/actionmap.ccg b/gio/src/actionmap.ccg
index ff79bbd..7b09fe7 100644
--- a/gio/src/actionmap.ccg
+++ b/gio/src/actionmap.ccg
@@ -39,6 +39,17 @@ ActionMap::add_action(const Glib::ustring& name, const ActivateSlot& slot)
   return action;
 }
 
+_DEPRECATE_IFDEF_START
+Glib::RefPtr<SimpleAction>
+ActionMap::add_action_with_parameter(
+  const Glib::ustring& name, const ActivateWithParameterSlot& slot)
+{
+  auto action = add_action(name);
+  action->signal_activate().connect(slot);
+  return action;
+}
+_DEPRECATE_IFDEF_END
+
 Glib::RefPtr<SimpleAction>
 ActionMap::add_action_with_parameter(
   const Glib::ustring& name, const Glib::VariantType& parameter_type, const ActivateWithParameterSlot& slot)
diff --git a/gio/src/actionmap.hg b/gio/src/actionmap.hg
index 4ec1441..4d3a1f7 100644
--- a/gio/src/actionmap.hg
+++ b/gio/src/actionmap.hg
@@ -95,6 +95,20 @@ public:
    */
   using ActivateWithParameterSlot = sigc::slot<void(const Glib::VariantBase&)>;
 
+_DEPRECATE_IFDEF_START
+  /** A convenience method for creating a SimpleAction instance
+   * and adding it to the ActionMap.
+   *
+   * @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.
+   *
+   * @deprecated Use the add_action_with_parameter() override that takes the parameter_type.
+   */
+  Glib::RefPtr<SimpleAction> add_action_with_parameter(const Glib::ustring& name, const 
ActivateWithParameterSlot& slot);
+_DEPRECATE_IFDEF_END
+
   /** A convenience method for creating a SimpleAction instance
    * and adding it to the ActionMap.
    *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]