gtk+ r20276 - in branches/gtk-2-12: . gtk
- From: matthiasc svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r20276 - in branches/gtk-2-12: . gtk
- Date: Mon, 2 Jun 2008 21:45:59 +0000 (UTC)
Author: matthiasc
Date: Mon Jun 2 21:45:59 2008
New Revision: 20276
URL: http://svn.gnome.org/viewvc/gtk+?rev=20276&view=rev
Log:
* gtk/gtksearchenginetracker.c: (_gtk_search_engine_tracker_new):
check that tracker is actually working before using it. Fixes
bug #479197.
Modified:
branches/gtk-2-12/ChangeLog
branches/gtk-2-12/gtk/gtksearchenginetracker.c
Modified: branches/gtk-2-12/gtk/gtksearchenginetracker.c
==============================================================================
--- branches/gtk-2-12/gtk/gtksearchenginetracker.c (original)
+++ branches/gtk-2-12/gtk/gtksearchenginetracker.c Mon Jun 2 21:45:59 2008
@@ -35,6 +35,7 @@
static TrackerClient * (*tracker_connect) (gboolean enable_warnings) = NULL;
static void (*tracker_disconnect) (TrackerClient *client) = NULL;
+static int (*tracker_get_version) (TrackerClient *client, GError **error) = NULL;
static void (*tracker_cancel_last_call) (TrackerClient *client) = NULL;
static void (*tracker_search_metadata_by_text_async) (TrackerClient *client,
@@ -56,6 +57,7 @@
#define MAP(a) { #a, (gpointer *)&a }
MAP (tracker_connect),
MAP (tracker_disconnect),
+ MAP (tracker_get_version),
MAP (tracker_cancel_last_call),
MAP (tracker_search_metadata_by_text_async),
MAP (tracker_search_metadata_by_text_and_location_async),
@@ -285,6 +287,7 @@
{
GtkSearchEngineTracker *engine;
TrackerClient *tracker_client;
+ GError *err = NULL;
open_libtracker ();
@@ -296,6 +299,18 @@
if (!tracker_client)
return NULL;
+ if (!tracker_get_version)
+ return NULL;
+
+ tracker_get_version (tracker_client, &err);
+
+ if (err != NULL)
+ {
+ g_error_free (err);
+ tracker_disconnect (tracker_client);
+ return NULL;
+ }
+
engine = g_object_new (GTK_TYPE_SEARCH_ENGINE_TRACKER, NULL);
engine->priv->client = tracker_client;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]