[tracker/needle: 15/34] tracker-needle: Support opening applications



commit 6943a280251320d9f36d9b24e89b5ce31e2e10a8
Author: Martyn Russell <martyn lanedo com>
Date:   Sat Jul 3 00:04:26 2010 +0100

    tracker-needle: Support opening applications

 src/tracker-needle/tracker-needle.vala |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/tracker-needle/tracker-needle.vala b/src/tracker-needle/tracker-needle.vala
index 725beff..76aae12 100644
--- a/src/tracker-needle/tracker-needle.vala
+++ b/src/tracker-needle/tracker-needle.vala
@@ -380,10 +380,16 @@ public class TrackerNeedle {
 		var model = view.get_model ();
 		model.get_iter (out iter, path);
 
-		weak string filename;
-		model.get (iter, 1, out filename);
+		weak string uri;
+		model.get (iter, 3, out uri);
 
-		debug ("Selected filename:'%s'", filename);
+		debug ("Selected uri:'%s'", uri);
+
+        try {
+            AppInfo.launch_default_for_uri (uri, null);
+        } catch (GLib.Error e) {
+            warning ("Could not launch application: " + e.message);
+        }
 	}
 	
 	private void show_stats_clicked () {



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