[glibmm] Gio::SimpleActionGroup: Some API improvements.



commit 993631fddccd3fbf36e9bd77e951657ebf4ac7e2
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Aug 7 09:53:02 2013 +0200

    Gio::SimpleActionGroup: Some API improvements.
    
    * gio/src/simpleactiongroup.hg: lookup(): Add a const version
      and use refreturn. Deprecate both lookup() methods,
      however, because they just call lookup_action() in the
      base ActionMap.
      Deprecate insert() and remove() because they just call
      add_action() and remove_action() in the base ActionMap,
      confusing the API.
      I filed bug #705600 about this API problem in the C API,
      hoping they can be deprecated there.

 gio/src/simpleactiongroup.hg |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gio/src/simpleactiongroup.hg b/gio/src/simpleactiongroup.hg
index d89099f..9055877 100644
--- a/gio/src/simpleactiongroup.hg
+++ b/gio/src/simpleactiongroup.hg
@@ -47,11 +47,15 @@ public:
   _WRAP_METHOD_DOCS_ONLY(g_simple_action_group_new)
   _WRAP_CREATE()
 
-  _WRAP_METHOD(Glib::RefPtr<Action> lookup(const Glib::ustring& action_name), g_simple_action_group_lookup)
-  _WRAP_METHOD(void insert(const Glib::RefPtr<Action>& action), g_simple_action_group_insert)
-  _WRAP_METHOD(void remove(const Glib::ustring& action_name), g_simple_action_group_remove)
+  _WRAP_METHOD(Glib::RefPtr<Action> lookup(const Glib::ustring& action_name), g_simple_action_group_lookup, 
refreturn, deprecated "Use ActionMap::lookup_action() instead")
+  _WRAP_METHOD(Glib::RefPtr<const Action> lookup(const Glib::ustring& action_name) const, 
g_simple_action_group_lookup, refreturn, constversion, deprecated "Use ActionMap::lookup_action() instead")
 
-  //TODO?: _WRAP_METHOD(void add_entries(const GActionEntry* entries, int n_entries, gpointer user_data), 
g_simple_action_group_add_entries)
+  _WRAP_METHOD(void insert(const Glib::RefPtr<Action>& action), g_simple_action_group_insert, deprecated 
"Use ActionMap::add_action() instead")
+  _WRAP_METHOD(void remove(const Glib::ustring& action_name), g_simple_action_group_remove, deprecated "Use 
ActionMap::remove_action() instead")
+
+  //We ignore g_simple_action_group_add_entries() because it does nothing but call 
g_action_map_add_action_entries(),
+  //which is already in the base class.
+  _IGNORE(g_simple_action_group_add_entries)
 };
 
 } // namespace Gio


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