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



commit 457aad3d7227287f3946d23c12d087d0015d2299
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]