summaryrefslogtreecommitdiffstats
path: root/gnome-panel-search.patch
blob: 277ba9f80ef364be53f13068915a8b19428276ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
diff -up gnome-panel-2.27.91/gnome-panel/libpanel-util/panel-launch.c.search gnome-panel-2.27.91/gnome-panel/libpanel-util/panel-launch.c
--- gnome-panel-2.27.91/gnome-panel/libpanel-util/panel-launch.c.search	2009-04-19 13:45:09.000000000 -0400
+++ gnome-panel-2.27.91/gnome-panel/libpanel-util/panel-launch.c	2009-08-25 11:33:36.666288948 -0400
@@ -29,6 +29,8 @@
 #include <gdk/gdk.h>
 #include <gtk/gtk.h>
 
+#include <libgnome/gnome-desktop-item.h>
+
 #include "panel-error.h"
 #include "panel-glib.h"
 
@@ -201,6 +203,23 @@ panel_launch_desktop_file (const char  *
 }
 
 gboolean
+panel_has_desktop_file (const char  *desktop_file)
+{
+	GnomeDesktopItem *ditem;
+
+	if (g_path_is_absolute (desktop_file))
+		ditem = gnome_desktop_item_new_from_file (desktop_file, 0, NULL);
+	else
+		ditem = gnome_desktop_item_new_from_basename (desktop_file, 0, NULL);
+	if (ditem != NULL) {
+		gnome_desktop_item_unref (ditem);
+		return TRUE;
+	}
+
+	return FALSE;	
+}
+
+gboolean
 panel_launch_desktop_file_with_fallback (const char  *desktop_file,
 					 const char  *fallback_exec,
 					 GdkScreen   *screen,
diff -up gnome-panel-2.27.91/gnome-panel/libpanel-util/panel-launch.h.search gnome-panel-2.27.91/gnome-panel/libpanel-util/panel-launch.h
--- gnome-panel-2.27.91/gnome-panel/libpanel-util/panel-launch.h.search	2009-04-19 13:45:09.000000000 -0400
+++ gnome-panel-2.27.91/gnome-panel/libpanel-util/panel-launch.h	2009-08-25 11:33:36.667276923 -0400
@@ -47,6 +47,8 @@ gboolean panel_launch_key_file (GKeyFile
 				GdkScreen  *screen,
 				GError    **error);
 
+gboolean panel_has_desktop_file (const char *desktop_file);
+
 gboolean panel_launch_desktop_file (const char  *desktop_file,
 				    GdkScreen   *screen,
 				    GError     **error);
diff -up gnome-panel-2.27.91/gnome-panel/panel-action-button.c.search gnome-panel-2.27.91/gnome-panel/panel-action-button.c
--- gnome-panel-2.27.91/gnome-panel/panel-action-button.c.search	2009-04-19 13:45:09.000000000 -0400
+++ gnome-panel-2.27.91/gnome-panel/panel-action-button.c	2009-08-25 11:33:36.671290074 -0400
@@ -219,9 +219,19 @@ panel_action_search (GtkWidget *widget)
 	GdkScreen *screen;
 
 	screen = gtk_widget_get_screen (widget);
-	panel_launch_desktop_file_with_fallback ("gnome-search-tool.desktop",
-						 "gnome-search-tool",
-						 screen, NULL);
+	if (panel_has_desktop_file ("gnome-beagle-search.desktop")) {
+		panel_launch_desktop_file ("gnome-beagle-search.desktop",
+					   screen,
+					   NULL);
+	} else if (panel_has_desktop_file ("fedora-tracker-search-tool.desktop")) {
+		panel_launch_desktop_file ("fedora-tracker-search-tool.desktop",
+					   screen,
+					   NULL);
+	} else {
+		panel_launch_desktop_file ("gnome-search-tool.desktop",
+					   screen,
+					   NULL);
+	}
 }
 
 /* Force Quit
diff -up gnome-panel-2.27.91/gnome-panel/panel-menu-items.c.search gnome-panel-2.27.91/gnome-panel/panel-menu-items.c
--- gnome-panel-2.27.91/gnome-panel/panel-menu-items.c.search	2009-08-25 11:33:36.643267021 -0400
+++ gnome-panel-2.27.91/gnome-panel/panel-menu-items.c	2009-08-25 11:42:41.517027329 -0400
@@ -1062,10 +1062,22 @@ panel_place_menu_item_create_menu (Panel
 
 	add_menu_separator (places_menu);
 
-	panel_menu_items_append_from_desktop (places_menu,
-					      "gnome-search-tool.desktop",
-					      NULL,
-                                              FALSE);
+	if (panel_has_desktop_file ("gnome-beagle-search.desktop")) {
+		panel_menu_items_append_from_desktop (places_menu,
+						      "gnome-beagle-search.desktop",
+						      NULL,
+						      FALSE);
+	} else if (panel_has_desktop_file ("fedora-tracker-search-tool.desktop")) {
+		panel_menu_items_append_from_desktop (places_menu,
+						      "fedora-tracker-search-tool.desktop",
+						      NULL,
+						      FALSE);
+	} else {
+		panel_menu_items_append_from_desktop (places_menu,
+						      "gnome-search-tool.desktop",
+						      NULL,
+						      FALSE);
+	}
 
 	panel_recent_append_documents_menu (places_menu,
 					    place_item->priv->recent_manager);