[tracker/tracker-needle-model] needle: Launch apps correctly



commit 60fac3fd4f4ee69c6ee41219fcf02a63a5cadeec
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Mar 21 19:04:51 2011 +0100

    needle: Launch apps correctly

 src/tracker-needle/tracker-needle.vala |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/tracker-needle/tracker-needle.vala b/src/tracker-needle/tracker-needle.vala
index e5b515f..e2c9a96 100644
--- a/src/tracker-needle/tracker-needle.vala
+++ b/src/tracker-needle/tracker-needle.vala
@@ -606,10 +606,15 @@ public class Tracker.Needle {
 	private void launch_selected (TreeModel model, TreePath path, int col) {
 		TreeIter iter;
 		model.get_iter (out iter, path);
-		
+
 		weak string uri;
 		model.get (iter, col, out uri);
-		debug ("Selected uri:'%s'", uri);
+
+                if (uri == null) {
+	                return;
+                }
+
+                debug ("Selected uri:'%s'", uri);
 
 		// Bit of a hack for now if there is no URI scheme, we assume that
 		// the uri is actually a command line to launch.
@@ -647,12 +652,12 @@ 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);
+		launch_selected (model, path, 1);
 	}
 
 	private void icon_item_selected (IconView view, TreePath path) {
 		var model = view.get_model ();
-		launch_selected (model, path, 3);
+		launch_selected (model, path, 1);
 	}
 
 	private void show_tags_clicked () {



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