[brasero/gnome-2-30] Fixed a runtime warning related to cancelling tracker searches



commit 88c1ec285e004ae3549f13df2c7e60b13bd96da8
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Mon May 10 22:57:27 2010 +0200

    Fixed a runtime warning related to cancelling tracker searches

 src/brasero-search-tracker.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/brasero-search-tracker.c b/src/brasero-search-tracker.c
index 4b65c9c..24ff29f 100644
--- a/src/brasero-search-tracker.c
+++ b/src/brasero-search-tracker.c
@@ -34,6 +34,8 @@ struct _BraseroSearchTrackerPrivate
 
 	gchar **mimes;
 	gchar *keywords;
+
+	guint current_call_id;
 };
 
 #define BRASERO_SEARCH_TRACKER_PRIVATE(o)  (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_SEARCH_TRACKER, BraseroSearchTrackerPrivate))
@@ -228,10 +230,10 @@ brasero_search_tracker_query_start_real (BraseroSearchEngine *search,
 			 "OFFSET 0 "
 			 "LIMIT 10000");
 
-	res = tracker_resources_sparql_query_async (priv->client,
-						    query->str,
-						    brasero_search_tracker_reply,
-						    search);
+	priv->current_call_id = tracker_resources_sparql_query_async (priv->client,
+								      query->str,
+	                                                              brasero_search_tracker_reply,
+	                                                              search);
 	g_string_free (query, TRUE);
 
 	return res;
@@ -305,7 +307,8 @@ brasero_search_tracker_clean (BraseroSearchTracker *search)
 
 	priv = BRASERO_SEARCH_TRACKER_PRIVATE (search);
 
-	tracker_cancel_last_call (priv->client);
+	if (priv->current_call_id)
+		tracker_cancel_call (priv->client, priv->current_call_id);
 
 	if (priv->results) {
 		g_ptr_array_foreach (priv->results, (GFunc) g_strfreev, NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]