[gtkmm] TreeModel: Use const_iterator for some vfunc parameters.



commit 2a2e78a47cf05dbe7357eac1a7274d510b39536a
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Mar 15 14:42:22 2017 +0100

    TreeModel: Use const_iterator for some vfunc parameters.

 gtk/src/treemodel.ccg |    2 +-
 gtk/src/treemodel.hg  |   10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/gtk/src/treemodel.ccg b/gtk/src/treemodel.ccg
index e43d5c6..599a8a9 100644
--- a/gtk/src/treemodel.ccg
+++ b/gtk/src/treemodel.ccg
@@ -569,7 +569,7 @@ g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Ge
   return RType();
 }
 
-int TreeModel::iter_n_children_vfunc(const iterator& iter) const
+int TreeModel::iter_n_children_vfunc(const const_iterator& iter) const
 {
   const auto base = static_cast<BaseClassType*>(
       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C 
interface).
diff --git a/gtk/src/treemodel.hg b/gtk/src/treemodel.hg
index b53c5dd..06af610 100644
--- a/gtk/src/treemodel.hg
+++ b/gtk/src/treemodel.hg
@@ -328,13 +328,15 @@ dnl
   _POP()
 #m4end
 
+#m4 _CONVERSION(`GtkTreeIter*',`const const_iterator&',`Gtk::TreeModel::const_iterator(self, $3)')
+
   /** Override and implement this in a derived TreeModel class.
    * Returns true if @a iter has children, false otherwise.
    *
    * @param iter The iterator to test for children.
    * @result true if @a iter has children.
    */
-  _WRAP_VFUNC(bool iter_has_child(const iterator& iter) const, iter_has_child)
+  _WRAP_VFUNC(bool iter_has_child(const const_iterator& iter) const, iter_has_child)
 
   /** Override and implement this in a derived TreeModel class.
    * Returns the number of children that @a iter has.
@@ -343,7 +345,7 @@ dnl
    * @param iter The iterator to test for children.
    * @result The number of children of @a iter.
    */
-  virtual int iter_n_children_vfunc(const iterator& iter) const;
+  virtual int iter_n_children_vfunc(const const_iterator& iter) const;
 
   /** Override and implement this in a derived TreeModel class.
    * Returns the number of toplevel nodes.
@@ -390,7 +392,7 @@ dnl
    * @result The path.
    */
 #m4 _CONVERSION(`TreeModel::Path', `GtkTreePath*', `($3).gobj_copy()')
-  _WRAP_VFUNC(TreeModel::Path get_path(const iterator& iter) const, get_path)
+  _WRAP_VFUNC(TreeModel::Path get_path(const const_iterator& iter) const, get_path)
 
   /** Override and implement this in a derived TreeModel class.
    * Initializes and sets @a value to that at @a column.
@@ -399,7 +401,7 @@ dnl
    * @param column The column to lookup the value at.
    * @param value An empty Glib:Value to set.
    */
-  _WRAP_VFUNC(void get_value(const iterator& iter, int column, Glib::ValueBase& value) const, get_value)
+  _WRAP_VFUNC(void get_value(const const_iterator& iter, int column, Glib::ValueBase& value) const, 
get_value)
 
   //Called by TreeRow, which is a friend class:
   //The comment about row_changed() in the documentation is based on my reading of the source of


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