[glibmm] MenuItem: get_attribute(): Remove const overload / make it const.



commit 45b9a5e3fc0aabece01394c2cc3520436d027ed2
Author: Murray Cumming <murrayc murrayc com>
Date:   Sat Oct 6 14:25:05 2012 +0200

    MenuItem: get_attribute(): Remove const overload / make it const.
    
            * gio/src/menuitem.hg: It does not make sense to have a return
    by value that is const.
            * gio/src/menuattributeiter.hg:
            * gio/src/menumodel.hg: Add TODOs for a future ABI break, so we can
    fix the same problem here.

 ChangeLog                    |   10 ++++++++++
 gio/src/menuattributeiter.hg |    2 ++
 gio/src/menuitem.hg          |    3 +--
 gio/src/menumodel.hg         |    3 +++
 4 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6bb1c1b..abcd909 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-10-06  Murray Cumming  <murrayc murrayc com>
+
+        MenuItem: get_attribute(): Remove const overload / make it const.
+
+        * gio/src/menuitem.hg: It does not make sense to have a return 
+	by value that is const.
+        * gio/src/menuattributeiter.hg:
+        * gio/src/menumodel.hg: Add TODOs for a future ABI break, so we can 
+	fix the same problem here.
+
 2012-10-04  Josà Alburquerque  <jaalburquerque gmail com>
 
 	MenuItem: Rename the get_attribute_value() methods to get_attribute().
diff --git a/gio/src/menuattributeiter.hg b/gio/src/menuattributeiter.hg
index b6ef95d..c66b45e 100644
--- a/gio/src/menuattributeiter.hg
+++ b/gio/src/menuattributeiter.hg
@@ -39,6 +39,8 @@ public:
 
   _WRAP_METHOD(Glib::ustring get_name() const, g_menu_attribute_iter_get_name)
 
+  //TODO: When we can break ABI, remove the method overload and just make it const.
+  //It makes no sense to return const by value.
   _WRAP_METHOD(Glib::VariantBase get_value(), g_menu_attribute_iter_get_value)
   _WRAP_METHOD(const Glib::VariantBase get_value() const, g_menu_attribute_iter_get_value, constversion)
 
diff --git a/gio/src/menuitem.hg b/gio/src/menuitem.hg
index 4843da8..04bf068 100644
--- a/gio/src/menuitem.hg
+++ b/gio/src/menuitem.hg
@@ -59,8 +59,7 @@ public:
   _WRAP_METHOD(void set_submenu(const Glib::RefPtr<MenuModel>& submenu), g_menu_item_set_submenu)
   _WRAP_METHOD(void set_section(const Glib::RefPtr<MenuModel>& section), g_menu_item_set_section)
 
-  _WRAP_METHOD(Glib::VariantBase get_attribute(const Glib::ustring& attribute, const Glib::VariantType& expected_type{?}), g_menu_item_get_attribute_value)
-  _WRAP_METHOD(const Glib::VariantBase get_attribute(const Glib::ustring& attribute, const Glib::VariantType& expected_type{?}) const, g_menu_item_get_attribute_value, constversion)
+  _WRAP_METHOD(Glib::VariantBase get_attribute(const Glib::ustring& attribute, const Glib::VariantType& expected_type{?}) const, g_menu_item_get_attribute_value)
 
   // Ignore varargs function.
   _IGNORE(g_menu_item_get_attribute)
diff --git a/gio/src/menumodel.hg b/gio/src/menumodel.hg
index 155c2fe..fc01ef2 100644
--- a/gio/src/menumodel.hg
+++ b/gio/src/menumodel.hg
@@ -131,6 +131,9 @@ protected:
 public:
 #m4begin
 dnl See the .ccg implementation for how this conversion works.
+
+  //TODO: When we can break ABI, remove the method overload and just make it const.
+  //It makes no sense to return const by value.
   _CONVERSION(`MenuAttribute',`const gchar*',`giomm_get_menu_attribute($3)')
 #m4end
   _WRAP_METHOD(Glib::VariantBase get_item_attribute(int item_index, MenuAttribute attribute, const Glib::VariantType& expected_type), g_menu_model_get_item_attribute_value)



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