[tracker/tst-ui-fixes] t-s-t: Use GAppInfo to launch default application.



commit 21422678e99c1f8e496d83fccca5ebb1be1cbc34
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Mar 24 13:33:48 2010 +0100

    t-s-t: Use GAppInfo to launch default application.

 src/tracker-search-tool/tracker-utils.gs |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/src/tracker-search-tool/tracker-utils.gs b/src/tracker-search-tool/tracker-utils.gs
index f5506c0..78f73ad 100644
--- a/src/tracker-search-tool/tracker-utils.gs
+++ b/src/tracker-search-tool/tracker-utils.gs
@@ -85,7 +85,6 @@ class TrackerUtils
 
 
     def static OpenUri (uri : string, is_dir :bool) : bool
-        command : string
         app_info : AppInfo
 
         var file = File.new_for_uri (uri)
@@ -98,20 +97,16 @@ class TrackerUtils
             msg.run ();
             return false
 
-        if is_dir is true  and app_info.get_executable() is "nautilus"
-            command = "nautilus --sm-disable --no-desktop --no-default-window '" + uri + "'"
-        else
-            command = app_info.get_executable () + " '" + uri + "'"
-
         try
-            Process.spawn_command_line_async (command)
-            return true
+            app_info.launch_default_for_uri (uri, null)
         except e: Error
             var msg = new MessageDialog (null, DialogFlags.MODAL, MessageType.ERROR, ButtonsType.OK, \
                                          N_("Could not lauch %s\nError: %s\n"), uri, e.message)
             msg.run ();
             return false
 
+        return true
+
 
     def static inline GetThemePixbufByName (icon_name : string, size : int, screen : Gdk.Screen) :  Gdk.Pixbuf?
 



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