Commit d8f3119f authored by Josselin Mouette's avatar Josselin Mouette

check that tracker is actually working before using it. Fixes bug #479197.

        * gtk/gtksearchenginetracker.c: (_gtk_search_engine_tracker_new):
        check that tracker is actually working before using it. Fixes
        bug #479197.

svn path=/trunk/; revision=20149
parent d0ffa630
2008-05-25 Josselin Mouette <joss@malsain.org>
reviewed by: Matthias Clasen
* gtk/gtksearchenginetracker.c: (_gtk_search_engine_tracker_new):
check that tracker is actually working before using it. Fixes
bug #479197.
2008-05-25 Sven Neumann <sven@gimp.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_realize)
......
......@@ -35,6 +35,7 @@ typedef void (*TrackerArrayReply) (char **result, GError *error, gpointer user_d
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 @@ static struct TrackerDlMapping
#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 @@ _gtk_search_engine_tracker_new (void)
{
GtkSearchEngineTracker *engine;
TrackerClient *tracker_client;
GError *err = NULL;
open_libtracker ();
......@@ -296,6 +299,18 @@ _gtk_search_engine_tracker_new (void)
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment