[gtkmm] TreeModel::iterator::operator--(): Use gtk_tree_model_iter_previous().



commit 23cf69f7bfde30492878f419507d91feddb184a9
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Jan 6 13:54:23 2011 +0100

    TreeModel::iterator::operator--(): Use gtk_tree_model_iter_previous().
    
    * gtk/src/treeiter.ccg: Use the new C function instead of the code that we
    copied from totem.

 ChangeLog            |    7 +++++++
 gtk/src/treeiter.ccg |   23 +++--------------------
 2 files changed, 10 insertions(+), 20 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a2cd10f..7e6fea3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-01-06  Murray Cumming  <murrayc murrayc com>
+
+	TreeModel::iterator::operator--(): Use gtk_tree_model_iter_previous().
+
+	* gtk/src/treeiter.ccg: Use the new C function instead of the code that we 
+	copied from totem.
+
 2011-01-05  Murray Cumming  <murrayc murrayc com>
 
 	Cursor: Make the API public, not protected, fixing the previous commit.
diff --git a/gtk/src/treeiter.ccg b/gtk/src/treeiter.ccg
index 7f4685b..6179589 100644
--- a/gtk/src/treeiter.ccg
+++ b/gtk/src/treeiter.ccg
@@ -19,24 +19,7 @@
  */
 
 #include <gtkmm/treemodel.h>
-
-namespace
-{
-
-// This is copied from Totem. In future there might be a version in GTK+ itself - see bug #
-static void gtkmm_gtk_tree_model_iter_previous(GtkTreeModel* tree_model, GtkTreeIter* iter)
-{
-  GtkTreePath *const path = gtk_tree_model_get_path(tree_model, iter);
-
-  if(gtk_tree_path_prev(path))
-    gtk_tree_model_get_iter(tree_model, iter, path);
-  else
-    g_assert_not_reached();
-
-  gtk_tree_path_free(path);
-}
-
-} // anonymous namespace
+#include <gtk/gtk.h>
 
 
 namespace Gtk
@@ -99,7 +82,7 @@ TreeIter& TreeIter::operator--()
 {
   if(!is_end_)
   {
-    gtkmm_gtk_tree_model_iter_previous(Glib::unwrap(model_), &gobject_);
+    gtk_tree_model_iter_previous(Glib::unwrap(model_), &gobject_);
   }
   else // --end yields last
   {
@@ -121,7 +104,7 @@ const TreeIter TreeIter::operator--(int)
 
   if(!is_end_)
   {
-    gtkmm_gtk_tree_model_iter_previous(Glib::unwrap(model_), &gobject_);
+    gtk_tree_model_iter_previous(Glib::unwrap(model_), &gobject_);
   }
   else // --end yields last
   {



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