[solang] Fixed retrieval of selected tags from TagView



commit 3f7a349318c799f28543c486c2c1825ef2721754
Author: Debarshi Ray <rishi gnu org>
Date:   Mon Dec 21 01:12:51 2009 +0200

    Fixed retrieval of selected tags from TagView

 src/attribute/tag-manager.cpp |   12 +++++++++---
 src/common/types.h            |    4 +---
 2 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/attribute/tag-manager.cpp b/src/attribute/tag-manager.cpp
index d6893be..9002cdf 100644
--- a/src/attribute/tag-manager.cpp
+++ b/src/attribute/tag-manager.cpp
@@ -342,11 +342,17 @@ TagManager::on_action_tag_delete() throw()
     DeletionQueue &queue
                 = application_->get_engine().get_delete_actions();
 
-    for( Gtk::TreeModel::iterator item = selected->get_selected();
-            item != selected->get_model()->children().end(); item++ )
+    const TreeModelPtr model = tagView_.get_model();
+    const TreePathList selected_rows = selected->get_selected_rows();
+
+    for (TreePathList::const_iterator iter = selected_rows.begin();
+         selected_rows.end() != iter;
+         iter++)
     {
-        Gtk::TreeModel::Row row= (*item);
+        Gtk::TreeModel::iterator model_iter = model->get_iter(*iter);
+        Gtk::TreeModel::Row row = *model_iter;
         TagPtr tag = row[ rec.get_column_tag() ];
+
         if( tag && tag->get_tag_id() )
         {
             DeleteActionPtr action = tag->get_delete_action();
diff --git a/src/common/types.h b/src/common/types.h
index 7cee9d7..0b64819 100644
--- a/src/common/types.h
+++ b/src/common/types.h
@@ -267,9 +267,7 @@ typedef Glib::RefPtr<const Gtk::TreeModelFilter>
     ConstTreeModelFilterPtr;
 typedef Glib::RefPtr<Gtk::TreeModelFilter> TreeModelFilterPtr;
 
-typedef Glib::RefPtr<const Gtk::TreePath> ConstTreePathPtr;
-typedef Glib::RefPtr<Gtk::TreePath> TreePathPtr;
-typedef std::vector<TreePathPtr> TreePathList;
+typedef std::vector<Gtk::TreeModel::Path> TreePathList;
 
 typedef Glib::RefPtr<const Gtk::UIManager> ConstUIManagerPtr;
 typedef Glib::RefPtr<Gtk::UIManager> UIManagerPtr;



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