[glibmm] Gio::Menu: Allow detailed_action == null



commit 3749314afd84bd2093a96b429daf3dc117ce5ca9
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Fri Jul 25 12:45:32 2014 +0200

    Gio::Menu: Allow detailed_action == null
    
    * gio/src/menu.hg: insert/prepend/append(): Make it possible to pass
    detailed_action == 0 to the glib/gio functions. Bug #733203.

 gio/src/menu.hg |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gio/src/menu.hg b/gio/src/menu.hg
index 69ae591..ad129a9 100644
--- a/gio/src/menu.hg
+++ b/gio/src/menu.hg
@@ -55,11 +55,13 @@ public:
   _WRAP_METHOD(void remove(int position), g_menu_remove)
   _WRAP_METHOD(void remove_all(), g_menu_remove_all)
 
-//TODO: Allow label to be null. But when would that be useful?
+// The glib docs says that label can be null in all insert/prepend/append functions.
+// But except in the xxx_section() functions, a null label results in a critical message,
+// and does not seem useful. See https://bugzilla.gnome.org/show_bug.cgi?id=733203
 //We don't return the MenuItem* because the C API can't give us something modifiable: See 
https://bugzilla.gnome.org/show_bug.cgi?id=708906
-  _WRAP_METHOD(void insert(int position, const Glib::ustring& label, const Glib::ustring& detailed_action = 
Glib::ustring()), g_menu_insert)
-  _WRAP_METHOD(void prepend(const Glib::ustring& label, const Glib::ustring& detailed_action = 
Glib::ustring()), g_menu_prepend)
-  _WRAP_METHOD(void append(const Glib::ustring& label, const Glib::ustring& detailed_action = 
Glib::ustring()), g_menu_append)
+  _WRAP_METHOD(void insert(int position, const Glib::ustring& label, const Glib::ustring& 
detailed_action{?}), g_menu_insert)
+  _WRAP_METHOD(void prepend(const Glib::ustring& label, const Glib::ustring& detailed_action{?}), 
g_menu_prepend)
+  _WRAP_METHOD(void append(const Glib::ustring& label, const Glib::ustring& detailed_action{?}), 
g_menu_append)
 
   _WRAP_METHOD(void insert_section(int position, const Glib::ustring& label{?}, const 
Glib::RefPtr<MenuModel>& section), g_menu_insert_section)
   _WRAP_METHOD(void prepend_section(const Glib::ustring& label{?}, const Glib::RefPtr<MenuModel>& section), 
g_menu_prepend_section)


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