[tracker/libtracker-sparql-porting: 8/42] tracker-status: Don't use TrackerSparqlConnection and unref DBusGProxy



commit dcec43e1aa53d2072deb9e134f27fdb88d917fa6
Author: Martyn Russell <martyn lanedo com>
Date:   Mon Jul 19 17:19:56 2010 +0100

    tracker-status: Don't use TrackerSparqlConnection and unref DBusGProxy

 src/tracker-utils/tracker-status.c |   29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)
---
diff --git a/src/tracker-utils/tracker-status.c b/src/tracker-utils/tracker-status.c
index 3147619..cc307bb 100644
--- a/src/tracker-utils/tracker-status.c
+++ b/src/tracker-utils/tracker-status.c
@@ -28,7 +28,6 @@
 #include <glib.h>
 #include <glib/gi18n.h>
 
-#include <libtracker-sparql/tracker-sparql.h>
 #include <libtracker-common/tracker-common.h>
 #include <libtracker-miner/tracker-miner.h>
 
@@ -465,7 +464,6 @@ main (gint argc, gchar *argv[])
 {
 	TrackerMinerManager *manager;
 	GOptionContext *context;
-	TrackerSparqlConnection *connection;
 	GSList *miners_available;
 	GSList *miners_running;
 	GSList *l;
@@ -537,15 +535,6 @@ main (gint argc, gchar *argv[])
 		g_thread_init (NULL);
 	}
 
-	connection = tracker_sparql_connection_get (NULL);
-
-	if (!connection) {
-		g_printerr ("%s\n",
-		            _("Could not establish a D-Bus connection to Tracker"));
-
-		return EXIT_FAILURE;
-	}
-
 	manager = tracker_miner_manager_new ();
 	miners_available = tracker_miner_manager_get_available (manager);
 	miners_running = tracker_miner_manager_get_running (manager);
@@ -601,8 +590,11 @@ main (gint argc, gchar *argv[])
 
 		g_slist_foreach (miners_running, (GFunc) g_free, NULL);
 		g_slist_free (miners_running);
+                
+                if (proxy) {
+                        g_object_unref (proxy);
+                }
 
-		g_object_unref (connection);
 		return EXIT_SUCCESS;
 	}
 
@@ -747,7 +739,9 @@ main (gint argc, gchar *argv[])
 
 	if (!follow) {
 		/* Do nothing further */
-		g_object_unref (connection);
+                if (proxy) {
+                        g_object_unref (proxy);
+                }
 		g_print ("\n");
 		return EXIT_SUCCESS;
 	}
@@ -782,8 +776,13 @@ main (gint argc, gchar *argv[])
 	g_hash_table_unref (miners_progress);
 	g_hash_table_unref (miners_status);
 
-	g_object_unref (connection);
-	g_object_unref (manager);
+        if (proxy) {
+                g_object_unref (proxy);
+        }
+
+	if (manager) {
+                g_object_unref (manager);
+        }
 
 	return EXIT_SUCCESS;
 }



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