[glom/gtkmm4v4: 29/37] gtkmm4: DbAddDel: Use const_iterator.



commit 3ea9e9f7cdfaf2411e702b2b5628e86b98c13adc
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Mar 15 11:23:27 2017 +0100

    gtkmm4: DbAddDel: Use const_iterator.

 glom/mode_data/db_adddel/db_adddel.cc |   14 +++++++-------
 glom/mode_data/db_adddel/db_adddel.h  |   16 ++++++++--------
 2 files changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/glom/mode_data/db_adddel/db_adddel.cc b/glom/mode_data/db_adddel/db_adddel.cc
index beca583..2c5c046 100644
--- a/glom/mode_data/db_adddel/db_adddel.cc
+++ b/glom/mode_data/db_adddel/db_adddel.cc
@@ -406,7 +406,7 @@ Gtk::TreeModel::iterator DbAddDel::get_row(const Gnome::Gda::Value& key)
   return  m_list_store->children().end();
 }
 
-bool DbAddDel::select_item(const Gtk::TreeModel::iterator& iter, bool start_editing)
+bool DbAddDel::select_item(const Gtk::TreeModel::const_iterator& iter, bool start_editing)
 {
   //Find the first column with a layout_item:
   std::shared_ptr<const LayoutItem> layout_item;
@@ -424,7 +424,7 @@ bool DbAddDel::select_item(const Gtk::TreeModel::iterator& iter, bool start_edit
   return select_item(iter, *layout_item, start_editing);
 }
 
-bool DbAddDel::select_item(const Gtk::TreeModel::iterator& iter, const LayoutItem& layout_item, bool 
start_editing)
+bool DbAddDel::select_item(const Gtk::TreeModel::const_iterator& iter, const LayoutItem& layout_item, bool 
start_editing)
 {
   if(!m_list_store)
     return false;
@@ -1188,7 +1188,7 @@ DbAddDel::InnerIgnore::~InnerIgnore()
   m_pOuter = nullptr;
 }
 
-Gnome::Gda::Value DbAddDel::treeview_get_key(const Gtk::TreeModel::iterator& row) const
+Gnome::Gda::Value DbAddDel::treeview_get_key(const Gtk::TreeModel::const_iterator& row) const
 {
   Gnome::Gda::Value value;
 
@@ -1721,7 +1721,7 @@ Glib::RefPtr<const Gtk::TreeModel> DbAddDel::get_model() const
   return m_list_store;
 }
 
-bool DbAddDel::get_is_first_row(const Gtk::TreeModel::iterator& iter) const
+bool DbAddDel::get_is_first_row(const Gtk::TreeModel::const_iterator& iter) const
 {
   if(iter)
     return iter == get_model()->children().begin();
@@ -1729,7 +1729,7 @@ bool DbAddDel::get_is_first_row(const Gtk::TreeModel::iterator& iter) const
     return false;
 }
 
-bool DbAddDel::get_is_last_row(const Gtk::TreeModel::iterator& iter) const
+bool DbAddDel::get_is_last_row(const Gtk::TreeModel::const_iterator& iter) const
 {
   if(iter)
   {
@@ -1756,7 +1756,7 @@ Gtk::TreeModel::iterator DbAddDel::get_last_row()
     return Gtk::TreeModel::iterator();
 }
 
-Gnome::Gda::Value DbAddDel::get_value_key(const Gtk::TreeModel::iterator& iter) const
+Gnome::Gda::Value DbAddDel::get_value_key(const Gtk::TreeModel::const_iterator& iter) const
 {
   return treeview_get_key(iter);
 }
@@ -1777,7 +1777,7 @@ void DbAddDel::set_value_key(const Gtk::TreeModel::iterator& iter, const Gnome::
   }
 }
 
-bool DbAddDel::get_is_placeholder_row(const Gtk::TreeModel::iterator& iter) const
+bool DbAddDel::get_is_placeholder_row(const Gtk::TreeModel::const_iterator& iter) const
 {
   //g_warning("DbAddDel::get_is_placeholder_row()");
 
diff --git a/glom/mode_data/db_adddel/db_adddel.h b/glom/mode_data/db_adddel/db_adddel.h
index f6f3f52..8df14c8 100644
--- a/glom/mode_data/db_adddel/db_adddel.h
+++ b/glom/mode_data/db_adddel/db_adddel.h
@@ -87,11 +87,11 @@ public:
 
   void remove_item(const Gtk::TreeModel::iterator& iter);
 
-  Gnome::Gda::Value get_value(const Gtk::TreeModel::iterator& iter, const LayoutItem_Field& layout_item) 
const;
+  Gnome::Gda::Value get_value(const Gtk::TreeModel::const_iterator& iter, const LayoutItem_Field& 
layout_item) const;
 
   /** Get the row's hidden key
    */
-  Gnome::Gda::Value get_value_key(const Gtk::TreeModel::iterator& iter) const;
+  Gnome::Gda::Value get_value_key(const Gtk::TreeModel::const_iterator& iter) const;
 
   /** Set the row's hidden key
    */
@@ -112,8 +112,8 @@ public:
    * @param start_editing Whether editing should start in the cell.
    * @result Whether the row was successfully selected.
    */
-  bool select_item(const Gtk::TreeModel::iterator& iter, const LayoutItem& layout_item, bool start_editing = 
false);  //bool indicates success.
-  bool select_item(const Gtk::TreeModel::iterator& iter, bool start_editing = false);
+  bool select_item(const Gtk::TreeModel::const_iterator& iter, const LayoutItem& layout_item, bool 
start_editing = false);  //bool indicates success.
+  bool select_item(const Gtk::TreeModel::const_iterator& iter, bool start_editing = false);
 
   guint get_count() const;
 
@@ -130,18 +130,18 @@ public:
    */
   virtual void set_value_selected(const LayoutItem_Field& layout_item, const Gnome::Gda::Value& value);
 
-  bool get_is_first_row(const Gtk::TreeModel::iterator& iter) const;
+  bool get_is_first_row(const Gtk::TreeModel::const_iterator& iter) const;
 
   /** Check whether the row is the last (non-placeholder) row.
    * This will also return true if @a iter is the placeholder row,
    * but this should be used to identify the last real row.
    * @see get_is_placeholder_row()
    */
-  bool get_is_last_row(const Gtk::TreeModel::iterator& iter) const;
+  bool get_is_last_row(const Gtk::TreeModel::const_iterator& iter) const;
 
   /** @result Whether this is a blank row where date for a new row should be entered
    */
-  bool get_is_placeholder_row(const Gtk::TreeModel::iterator& iter) const;
+  bool get_is_placeholder_row(const Gtk::TreeModel::const_iterator& iter) const;
 
   std::shared_ptr<Field> get_key_field() const;
   void set_key_field(const std::shared_ptr<Field>& field);
@@ -308,7 +308,7 @@ protected:
   virtual void on_selection_changed(bool selection);
 
 private:
-  Gnome::Gda::Value treeview_get_key(const Gtk::TreeModel::iterator& row) const;
+  Gnome::Gda::Value treeview_get_key(const Gtk::TreeModel::const_iterator& row) const;
 
   ///Add a blank row, or return the existing blank row if there already is one.
   //Gtk::TreeModel::iterator get_next_available_row_with_add_if_necessary();


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