gtk2/libbeagle.patch

66 lines
2.5 KiB
Diff
Raw Normal View History

2008-02-26 06:19:48 +00:00
diff -up gtk+-2.12.8/gtk/gtksearchenginebeagle.c.libbeagle gtk+-2.12.8/gtk/gtksearchenginebeagle.c
--- gtk+-2.12.8/gtk/gtksearchenginebeagle.c.libbeagle 2008-02-26 01:17:35.000000000 -0500
+++ gtk+-2.12.8/gtk/gtksearchenginebeagle.c 2008-02-26 01:18:04.000000000 -0500
@@ -69,8 +69,6 @@ static GSList *(*beagle_hits_subtracted_
static BeagleQuery *(*beagle_query_new) (void) = NULL;
static void (*beagle_query_add_text) (BeagleQuery *query,
const char *str) = NULL;
-static void (*beagle_query_add_hit_type) (BeagleQuery *query,
- const char *hit_type) = NULL;
static void (*beagle_query_set_max_hits) (BeagleQuery *query,
gint max_hits) = NULL;
static BeagleQueryPartProperty *(*beagle_query_part_property_new) (void) = NULL;
@@ -102,7 +100,6 @@ static struct BeagleDlMapping
MAP (beagle_hits_subtracted_response_get_uris),
MAP (beagle_query_new),
MAP (beagle_query_add_text),
- MAP (beagle_query_add_hit_type),
MAP (beagle_query_set_max_hits),
MAP (beagle_query_part_property_new),
MAP (beagle_query_part_set_logic),
@@ -129,7 +126,10 @@ open_libbeagle (void)
done = TRUE;
- beagle = g_module_open ("libbeagle.so.0", G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
+ beagle = g_module_open ("libbeagle.so.1", G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
+ if (!beagle)
+ beagle = g_module_open ("libbeagle.so.0", G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
+
if (!beagle)
return;
@@ -274,6 +274,7 @@ gtk_search_engine_beagle_start (GtkSearc
GtkSearchEngineBeagle *beagle;
GError *error;
gchar *text;
+ gchar *query;
error = NULL;
beagle = GTK_SEARCH_ENGINE_BEAGLE (engine);
@@ -295,11 +296,13 @@ gtk_search_engine_beagle_start (GtkSearc
"error", G_CALLBACK (beagle_error), engine);
/* We only want files */
- beagle_query_add_hit_type (beagle->priv->current_query, "File");
- beagle_query_set_max_hits (beagle->priv->current_query, 1000);
+
text = _gtk_query_get_text (beagle->priv->query);
- beagle_query_add_text (beagle->priv->current_query, text);
+ query = g_strconcat (text, " type:File", NULL);
+
+ beagle_query_set_max_hits (beagle->priv->current_query, 1000);
+ beagle_query_add_text (beagle->priv->current_query, query);
beagle->priv->current_query_uri_prefix = _gtk_query_get_location (beagle->priv->query);
@@ -312,6 +315,7 @@ gtk_search_engine_beagle_start (GtkSearc
/* These must live during the lifetime of the query */
g_free (text);
+ g_free (query);
}
static void