Work with libbeagle.so.1

This commit is contained in:
Matthias Clasen 2008-02-26 06:19:48 +00:00
parent e7ccd35804
commit 8adf929e27
2 changed files with 73 additions and 1 deletions

View File

@ -16,7 +16,7 @@
Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X
Name: gtk2
Version: %{base_version}
Release: 1%{?dist}
Release: 2%{?dist}
License: LGPLv2+
Group: System Environment/Libraries
Source: http://download.gnome.org/sources/gtk+/2.12/gtk+-%{version}.tar.bz2
@ -37,6 +37,9 @@ Patch3: system-log-crash.patch
# backport from svn trunk
Patch4: im-setting.patch
# fixed upstream
Patch5: libbeagle.patch
BuildRequires: atk-devel >= %{atk_version}
BuildRequires: pango-devel >= %{pango_version}
BuildRequires: glib2-devel >= %{glib2_version}
@ -116,6 +119,7 @@ docs for the GTK+ widget toolkit.
%patch2 -p1 -b .workaround
%patch3 -p1 -b .system-log-crash
%patch4 -p1 -b .im-setting
%patch5 -p1 -b .libbeagle
for i in config.guess config.sub ; do
test -f %{_datadir}/libtool/$i && cp %{_datadir}/libtool/$i .
@ -298,6 +302,9 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/gtk-2.0
%changelog
* Tue Feb 26 2008 Matthias Clasen <mclasen@redhat.com> - 2.12.8-2
- Work with libbeagle.so.1
* Tue Feb 12 2008 Matthias Clasen <mclasen@redhat.com> - 2.12.8-1
- Update to 2.12.8

65
libbeagle.patch Normal file
View File

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