Accepting request 41847 from GNOME:Apps

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
This commit is contained in:
OBS User autobuild 2010-06-21 17:45:37 +00:00 committed by Git OBS Bridge
parent 8f29986530
commit b9f30a4da9
4 changed files with 235 additions and 1 deletions

View File

@ -0,0 +1,197 @@
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

View File

@ -0,0 +1,11 @@
--- tracker-0.8.5/src/miners/fs/tracker-config.c 2010-05-06 17:52:04.000000000 +0530
+++ tracker-0.8.5-patched/src/miners/fs/tracker-config.c 2010-06-21 20:10:00.580688087 +0530
@@ -46,7 +46,7 @@
#define DEFAULT_SCAN_TIMEOUT 0 /* 0->1000 */
#define DEFAULT_CACHE_TIMEOUT 60 /* 0->1000 */
#define DEFAULT_INDEX_MOUNTED_DIRECTORIES TRUE
-#define DEFAULT_INDEX_REMOVABLE_DEVICES TRUE
+#define DEFAULT_INDEX_REMOVABLE_DEVICES FALSE
#define DEFAULT_INDEX_OPTICAL_DISCS FALSE
#define DEFAULT_INDEX_ON_BATTERY FALSE
#define DEFAULT_INDEX_ON_BATTERY_FIRST_TIME TRUE

View File

@ -1,3 +1,20 @@
-------------------------------------------------------------------
Mon Jun 21 17:02:28 CEST 2010 - badshah400@gmail.com
- Add tracker-removeable-media-off.patch to turn off indexing
removeable media by default.
-------------------------------------------------------------------
Fri Jun 18 18:13:03 CEST 2010 - vuntz@opensuse.org
- Add tracker-launch-applications-in-results.patch: since tracker
is used from the main menu, it's important that it handles
applications correctly. They should be correctly displayed and it
should launch them instead of opening the .desktop file in a text
editor.
- Add gnome-common BuildRequires and call gnome-autogen.sh for the
patch.
-------------------------------------------------------------------
Sun May 9 20:28:24 UTC 2010 - dimstar@opensuse.org

View File

@ -20,13 +20,17 @@
Name: tracker
Version: 0.8.5
Release: 1
Release: 2
# FIXME: 2010-03-24 building gtk-doc fails because of a bug in graphviz
License: GPLv2+
Summary: Powerful object database, tag/metadata database, search tool and indexer
Url: http://projects.gnome.org/tracker/
Group: Productivity/Other
Source: %{name}-%{version}.tar.bz2
# PATCH-FIX-UPSTREAM tracker-launch-applications-in-results.patch bgo621987 vuntz@opensuse.org -- Correctly handle applications in search results of the search tool
Patch0: tracker-launch-applications-in-results.patch
# PATCH-FIX-OPENSUSE tracker-removeable-media-off.patch bgo622288 badshah400@gmail.com -- Disable indexing on removable media by default. See bgo#622288 for how it should be done properly.
Patch1: tracker-removeable-media-off.patch
BuildRequires: DeviceKit-power-devel
BuildRequires: dbus-1-glib-devel
BuildRequires: enca-devel
@ -36,6 +40,8 @@ BuildRequires: fdupes
BuildRequires: flac-devel
BuildRequires: gcc-c++
BuildRequires: glib2-devel
# Only needed for patch0: tracker-launch-applications-in-results.patch
BuildRequires: gnome-common
BuildRequires: gnome-panel-devel
BuildRequires: graphviz
BuildRequires: gstreamer-0_10-plugins-base-devel
@ -239,8 +245,11 @@ This package contains an nautilus plugin for Tracker integration.
%prep
%setup -q
translation-update-upstream
%patch0 -p1
%patch1 -p1
%build
NOCONFIGURE=1 gnome-autogen.sh
%configure \
--enable-libvorbis \
--enable-libflac \