[tracker/needle: 53/53] tracker-needle: Fix launching from icon view



commit efd8466f328f11c842d5632605f8032a99182b77
Author: Martyn Russell <martyn lanedo com>
Date:   Fri Nov 12 23:45:04 2010 +0000

    tracker-needle: Fix launching from icon view

 src/tracker-needle/tracker-needle.vala |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/src/tracker-needle/tracker-needle.vala b/src/tracker-needle/tracker-needle.vala
index 13b9acf..1d9dd1c 100644
--- a/src/tracker-needle/tracker-needle.vala
+++ b/src/tracker-needle/tracker-needle.vala
@@ -257,7 +257,7 @@ public class Tracker.Needle {
 		iconview.set_selection_mode (Gtk.SelectionMode.SINGLE);
 		iconview.set_pixbuf_column (1);
 		iconview.set_text_column (4);
-		//iconview.row_activated += view_row_selected;
+		iconview.item_activated.connect (icon_item_selected);
 	}
 
 	private void search_changed (Editable editable) {
@@ -645,15 +645,12 @@ public class Tracker.Needle {
 		current_find_in = find_in_contents.active;
 	}
 
-	private void view_row_selected (TreeView view, TreePath path, TreeViewColumn column) {
+	private void launch_selected (TreeModel model, TreePath path, int col) {
 		TreeIter iter;
-
-		var model = view.get_model ();
 		model.get_iter (out iter, path);
-
+		
 		weak string uri;
-		model.get (iter, 3, out uri);
-
+		model.get (iter, col, out uri);
 		debug ("Selected uri:'%s'", uri);
 
 		try {
@@ -663,6 +660,16 @@ public class Tracker.Needle {
 		}
 	}
 
+	private void view_row_selected (TreeView view, TreePath path, TreeViewColumn column) {
+		var model = view.get_model ();
+		launch_selected (model, path, 3);
+	}
+
+	private void icon_item_selected (IconView view, TreePath path) {
+		var model = view.get_model ();
+		launch_selected (model, path, 3);
+	}
+
 	private void show_tags_clicked () {
 		if (show_tags.active) {
 			debug ("Showing tags");



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