b9f30a4da9
Copy from GNOME:Apps/tracker based on submit request 41847 from user vuntz OBS-URL: https://build.opensuse.org/request/show/41847 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/tracker?expand=0&rev=3
198 lines
8.9 KiB
Diff
198 lines
8.9 KiB
Diff
diff -ur '--exclude=*.c' tracker-0.8.6/configure.ac tracker-0.8.6-patched/configure.ac
|
|
--- tracker-0.8.6/configure.ac 2010-05-13 16:27:51.000000000 +0200
|
|
+++ tracker-0.8.6-patched/configure.ac 2010-06-18 17:02:22.562245099 +0200
|
|
@@ -921,6 +921,7 @@
|
|
####################################################################
|
|
|
|
APP_REQUIREMENTS="glib-2.0 >= $GLIB_REQUIRED
|
|
+ gio-unix-2.0 >= $GLIB_REQUIRED
|
|
gthread-2.0 >= $GLIB_REQUIRED
|
|
gmodule-2.0 >= $GLIB_REQUIRED
|
|
gtk+-2.0 >= $GTK_REQUIRED
|
|
diff -ur '--exclude=*.c' tracker-0.8.6/src/tracker-search-tool/Makefile.am tracker-0.8.6-patched/src/tracker-search-tool/Makefile.am
|
|
--- tracker-0.8.6/src/tracker-search-tool/Makefile.am 2010-04-21 15:08:46.000000000 +0200
|
|
+++ tracker-0.8.6-patched/src/tracker-search-tool/Makefile.am 2010-06-18 16:58:30.264022830 +0200
|
|
@@ -17,7 +17,7 @@
|
|
$(tracker_search_tool_VALASOURCES:.gs=.c)
|
|
|
|
tracker_search_tool.gs.stamp: $(tracker_search_tool_VALASOURCES)
|
|
- $(VALAC) -C -g --pkg dbus-glib-1 --pkg gee-1.0 --pkg gtk+-2.0 $^
|
|
+ $(VALAC) -C -g --pkg dbus-glib-1 --pkg gee-1.0 --pkg gio-unix-2.0 --pkg gtk+-2.0 $^
|
|
touch tracker_search_tool.gs.stamp
|
|
|
|
tracker_search_tool_CFLAGS = \
|
|
diff -ur '--exclude=*.c' tracker-0.8.6/src/tracker-search-tool/tracker-metadata-tile.gs tracker-0.8.6-patched/src/tracker-search-tool/tracker-metadata-tile.gs
|
|
--- tracker-0.8.6/src/tracker-search-tool/tracker-metadata-tile.gs 2010-05-11 13:41:59.000000000 +0200
|
|
+++ tracker-0.8.6-patched/src/tracker-search-tool/tracker-metadata-tile.gs 2010-06-18 17:55:48.896030513 +0200
|
|
@@ -206,6 +206,7 @@
|
|
info_value4.set_text ("")
|
|
info_value5.set_text ("")
|
|
info_value6.set_text ("")
|
|
+ info_label1.set_text (N_("Type:"))
|
|
info_label4.set_text ("")
|
|
info_label5.set_text ("")
|
|
info_label6.set_text ("")
|
|
@@ -216,7 +217,13 @@
|
|
path_link.label = ""
|
|
|
|
name_link.set_sensitive (false)
|
|
- path_link.set_sensitive (false);
|
|
+ path_link.set_sensitive (false)
|
|
+
|
|
+ name_label.show ()
|
|
+ path_label.show ()
|
|
+ info_label1.show ()
|
|
+ info_label2.show ()
|
|
+ info_label3.show ()
|
|
|
|
|
|
def SetLabelValue (label : Label, val : string)
|
|
@@ -358,7 +365,31 @@
|
|
SetLabelValue (info_value4, result[0])
|
|
SetLabelValue (info_value5, result[1])
|
|
SetLabelValue (info_value6, result[2])
|
|
+
|
|
+
|
|
+ def private DisplayApplicationDetails (uri : string)
|
|
+ app_info : AppInfo
|
|
+
|
|
+ var file = File.new_for_uri (uri)
|
|
+ app_info = new DesktopAppInfo.from_filename (file.get_path ())
|
|
+ if app_info is null
|
|
+ DisplayFileDetails (uri, "")
|
|
+ return
|
|
|
|
+ //name_link.set_sensitive (false)
|
|
+ path_link.set_sensitive (false)
|
|
+ path_label.hide ()
|
|
+ info_label2.hide ()
|
|
+ info_label3.hide ()
|
|
+
|
|
+ name_link.uri = uri
|
|
+ name_link.label = app_info.get_display_name ()
|
|
+ info_label1.set_text (N_("Description:"))
|
|
+
|
|
+ var description = app_info.get_description ()
|
|
+ if description is not null
|
|
+ SetLabelValue (info_value1, description)
|
|
+
|
|
|
|
def LoadUri (path : TreePath?)
|
|
ClearLabels ()
|
|
@@ -377,17 +408,19 @@
|
|
_result_grid.store.get_iter (out iter, path)
|
|
_result_grid.store.get (iter, ResultColumns.Id, out id, ResultColumns.Uri, out uri, ResultColumns.Mime, out mime, ResultColumns.Icon, out icon)
|
|
|
|
+ image.set_from_pixbuf (icon)
|
|
+
|
|
/* determine category type */
|
|
var cat = GetCategory (uri)
|
|
|
|
if cat is not Categories.Application
|
|
DisplayFileDetails (uri, mime)
|
|
- image.set_from_pixbuf (icon)
|
|
|
|
case cat
|
|
when Categories.Audio do DisplayAudioDetails (uri)
|
|
when Categories.Video do DisplayVideoDetails (uri)
|
|
when Categories.Image do DisplayImageDetails (uri)
|
|
when Categories.Document do DisplayDocumentDetails (uri)
|
|
+ when Categories.Application do DisplayApplicationDetails (uri)
|
|
default do return
|
|
|
|
diff -ur '--exclude=*.c' tracker-0.8.6/src/tracker-search-tool/tracker-result-grid.gs tracker-0.8.6-patched/src/tracker-search-tool/tracker-result-grid.gs
|
|
--- tracker-0.8.6/src/tracker-search-tool/tracker-result-grid.gs 2010-05-11 13:41:59.000000000 +0200
|
|
+++ tracker-0.8.6-patched/src/tracker-search-tool/tracker-result-grid.gs 2010-06-18 17:55:26.992072975 +0200
|
|
@@ -137,21 +137,37 @@
|
|
if uri.has_prefix ("file://")
|
|
|
|
has_results = true
|
|
+ var handled = false
|
|
|
|
var file = File.new_for_uri (uri)
|
|
|
|
- try
|
|
- var info = file.query_info ("standard::display-name,standard::icon,thumbnail::path", \
|
|
- FileQueryInfoFlags.NONE, null)
|
|
-
|
|
- var filetype = info.get_file_type ()
|
|
- store.append (out iter);
|
|
- store.set (iter, ResultColumns.Id, id, ResultColumns.Uri, uri, ResultColumns.Mime, mime, ResultColumns.Icon, GetThumbNail (info, 64, 48, get_screen()), \
|
|
- ResultColumns.DisplayName, info.get_display_name(), ResultColumns.IsDirectory, \
|
|
- (filetype is FileType.DIRECTORY) , -1)
|
|
-
|
|
- except e:Error
|
|
- print "Could not get file info for %s", uri
|
|
+ var query = "SELECT rdf:type(?s) where { ?s nie:url \"%s\" }".printf(uri)
|
|
+ var qresults = Query.Query (query)
|
|
+
|
|
+ if qresults is not null and qresults[0].contains ("nfo#Software")
|
|
+ app_info : AppInfo
|
|
+ app_info = new DesktopAppInfo.from_filename (file.get_path ())
|
|
+
|
|
+ if app_info is not null
|
|
+ store.append (out iter);
|
|
+ store.set (iter, ResultColumns.Id, id, ResultColumns.Uri, uri, ResultColumns.Mime, mime, ResultColumns.Icon, GetThemeIconPixbuf (app_info.get_icon (), 48, get_screen()), \
|
|
+ ResultColumns.DisplayName, app_info.get_display_name(), ResultColumns.IsDirectory, \
|
|
+ false , -1)
|
|
+ handled = true
|
|
+
|
|
+ if not handled
|
|
+ try
|
|
+ var info = file.query_info ("standard::display-name,standard::icon,thumbnail::path", \
|
|
+ FileQueryInfoFlags.NONE, null)
|
|
+
|
|
+ var filetype = info.get_file_type ()
|
|
+ store.append (out iter);
|
|
+ store.set (iter, ResultColumns.Id, id, ResultColumns.Uri, uri, ResultColumns.Mime, mime, ResultColumns.Icon, GetThumbNail (info, 64, 48, get_screen()), \
|
|
+ ResultColumns.DisplayName, info.get_display_name(), ResultColumns.IsDirectory, \
|
|
+ (filetype is FileType.DIRECTORY) , -1)
|
|
+
|
|
+ except e:Error
|
|
+ print "Could not get file info for %s", uri
|
|
|
|
/* select first result */
|
|
if has_results
|
|
@@ -171,4 +187,9 @@
|
|
store.get (iter, ResultColumns.Uri, out uri);
|
|
store.get (iter, ResultColumns.IsDirectory, out is_dir);
|
|
|
|
- OpenUri (uri, is_dir)
|
|
+ var query = "SELECT rdf:type(?s) where { ?s nie:url \"%s\" }".printf(uri)
|
|
+ var results = Query.Query (query)
|
|
+ if results is not null and results[0].contains ("nfo#Software")
|
|
+ LaunchApp (uri)
|
|
+ else
|
|
+ OpenUri (uri, is_dir)
|
|
diff -ur '--exclude=*.c' tracker-0.8.6/src/tracker-search-tool/tracker-utils.gs tracker-0.8.6-patched/src/tracker-search-tool/tracker-utils.gs
|
|
--- tracker-0.8.6/src/tracker-search-tool/tracker-utils.gs 2010-05-11 13:41:59.000000000 +0200
|
|
+++ tracker-0.8.6-patched/src/tracker-search-tool/tracker-utils.gs 2010-06-18 17:56:46.256030861 +0200
|
|
@@ -83,6 +83,27 @@
|
|
|
|
|
|
|
|
+ def static LaunchApp (uri : string) : bool
|
|
+ app_info : AppInfo
|
|
+ context : AppLaunchContext
|
|
+
|
|
+ var file = File.new_for_uri (uri)
|
|
+
|
|
+ app_info = new DesktopAppInfo.from_filename (file.get_path ())
|
|
+ if app_info is null
|
|
+ return OpenUri (uri, false)
|
|
+
|
|
+ context = new Gdk.AppLaunchContext ()
|
|
+ try
|
|
+ app_info.launch (null, context)
|
|
+ except e:Error
|
|
+ var msg = new MessageDialog (null, DialogFlags.MODAL, MessageType.ERROR, ButtonsType.OK, \
|
|
+ N_("Could not launch \"%s\"\nError: %s\n"), app_info.get_display_name (), e.message)
|
|
+ msg.run ();
|
|
+ return false
|
|
+
|
|
+ return true
|
|
+
|
|
|
|
def static OpenUri (uri : string, is_dir :bool) : bool
|
|
app_info : AppInfo
|