[tracker/gdbus: 26/92] libtracker-miner: Remove unused functions



commit 62c8cb676d8bd51ecfa6fdf2d32b79f7bb4ef266
Author: Philip Van Hoof <philip codeminded be>
Date:   Thu Dec 30 16:30:50 2010 +0100

    libtracker-miner: Remove unused functions

 src/libtracker-miner/tracker-dbus.c      |  204 ------------------------------
 src/libtracker-miner/tracker-dbus.h      |   10 --
 src/libtracker-miner/tracker-miner-web.c |    2 +
 3 files changed, 2 insertions(+), 214 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-dbus.c b/src/libtracker-miner/tracker-dbus.c
index e6bed9e..634a2fc 100644
--- a/src/libtracker-miner/tracker-dbus.c
+++ b/src/libtracker-miner/tracker-dbus.c
@@ -27,207 +27,3 @@
 
 #include "tracker-dbus.h"
 #include "tracker-miner-dbus.h"
-
-typedef struct {
-	DBusGConnection *connection;
-	GHashTable *name_monitors;
-} DBusData;
-
-static GQuark dbus_data = 0;
-static GQuark dbus_interface_quark = 0;
-static GQuark name_owner_changed_signal_quark = 0;
-
-static gboolean
-dbus_register_service (DBusGProxy  *proxy,
-                       const gchar *name)
-{
-	GError *error = NULL;
-	guint	result;
-
-	g_message ("Registering D-Bus service...\n"
-	           "  Name:'%s'",
-	           name);
-
-	if (!org_freedesktop_DBus_request_name (proxy,
-	                                        name,
-	                                        DBUS_NAME_FLAG_DO_NOT_QUEUE,
-	                                        &result, &error)) {
-		g_critical ("Could not acquire name:'%s', %s",
-		            name,
-		            error ? error->message : "no error given");
-		g_error_free (error);
-
-		return FALSE;
-	}
-
-	if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) {
-		g_critical ("D-Bus service name:'%s' is already taken, "
-		            "perhaps the application is already running?",
-		            name);
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
-static gboolean
-dbus_register_object (GObject               *object,
-                      DBusGConnection       *connection,
-                      DBusGProxy            *proxy,
-                      const DBusGObjectInfo *info,
-                      const gchar           *path)
-{
-	g_message ("Registering D-Bus object...");
-	g_message ("  Path:'%s'", path);
-	g_message ("  Object Type:'%s'", G_OBJECT_TYPE_NAME (object));
-
-	dbus_g_object_type_install_info (G_OBJECT_TYPE (object), info);
-	dbus_g_connection_register_g_object (connection, path, object);
-
-	return TRUE;
-}
-
-static void
-dbus_data_destroy (gpointer data)
-{
-	DBusData *dd;
-
-	dd = data;
-
-	if (dd->connection) {
-		dbus_g_connection_unref (dd->connection);
-	}
-
-	if (dd->name_monitors) {
-		g_hash_table_unref (dd->name_monitors);
-	}
-
-	g_slice_free (DBusData, dd);
-}
-
-static DBusData *
-dbus_data_create (TrackerMiner          *miner,
-                  const gchar           *name,
-                  const DBusGObjectInfo *info)
-{
-	DBusData *data;
-	DBusGConnection *connection;
-	DBusGProxy *gproxy;
-	GError *error = NULL;
-	gchar *full_name, *full_path;
-
-	connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
-
-	if (!connection) {
-		g_critical ("Could not connect to the D-Bus session bus, %s",
-			    error ? error->message : "no error given.");
-		g_error_free (error);
-		return NULL;
-	}
-
-	gproxy = dbus_g_proxy_new_for_name (connection,
-	                                    DBUS_SERVICE_DBUS,
-	                                    DBUS_PATH_DBUS,
-	                                    DBUS_INTERFACE_DBUS);
-
-	/* Register the service name for the miner */
-	full_name = g_strconcat (TRACKER_MINER_DBUS_NAME_PREFIX, name, NULL);
-
-	if (!dbus_register_service (gproxy, full_name)) {
-		g_object_unref (gproxy);
-		g_free (full_name);
-		return NULL;
-	}
-
-	g_free (full_name);
-
-	full_path = g_strconcat (TRACKER_MINER_DBUS_PATH_PREFIX, name, NULL);
-
-	if (!dbus_register_object (G_OBJECT (miner),
-	                           connection,
-	                           gproxy,
-	                           info,
-	                           full_path)) {
-		g_object_unref (gproxy);
-		g_free (full_path);
-		return NULL;
-	}
-
-	g_free (full_path);
-
-	/* Now we're successfully connected and registered, create the data */
-	data = g_slice_new0 (DBusData);
-
-	/* Connection object is a shared one, so we need to keep our own
-	 * reference to it
-	 */
-	data->connection = dbus_g_connection_ref (connection);
-	data->name_monitors = g_hash_table_new_full (g_str_hash,
-	                                             g_str_equal,
-	                                             (GDestroyNotify) g_free,
-	                                             NULL);
-
-	g_object_unref (gproxy);
-
-	return data;
-}
-
-void
-_tracker_miner_dbus_init (TrackerMiner          *miner,
-                          const DBusGObjectInfo *info)
-{
-	DBusData *data;
-	gchar *name;
-
-	g_return_if_fail (TRACKER_IS_MINER (miner));
-	g_return_if_fail (info != NULL);
-
-	if (G_UNLIKELY (dbus_data == 0)) {
-		dbus_data = g_quark_from_static_string ("tracker-miner-dbus-data");
-	}
-
-	data = g_object_get_qdata (G_OBJECT (miner), dbus_data);
-
-	if (data) {
-		return;
-	}
-
-	g_object_get (miner, "name", &name, NULL);
-
-	if (!name) {
-		g_critical ("Miner '%s' should have been given a name, bailing out",
-		            G_OBJECT_TYPE_NAME (miner));
-		g_assert_not_reached ();
-	}
-
-	dbus_interface_quark = g_quark_from_static_string ("org.freedesktop.DBus");
-	name_owner_changed_signal_quark = g_quark_from_static_string ("NameOwnerChanged");
-
-	data = dbus_data_create (miner, name, info);
-
-	if (G_UNLIKELY (!data)) {
-		g_critical ("Miner could not register object on D-Bus session");
-		exit (EXIT_FAILURE);
-		return;
-	}
-
-	g_object_set_qdata_full (G_OBJECT (miner),
-	                         dbus_data,
-	                         data,
-	                         dbus_data_destroy);
-
-	g_free (name);
-}
-
-void
-_tracker_miner_dbus_shutdown (TrackerMiner *miner)
-{
-	g_return_if_fail (TRACKER_IS_MINER (miner));
-
-	if (G_UNLIKELY (dbus_data == 0)) {
-		return;
-	}
-
-	g_object_set_qdata (G_OBJECT (miner), dbus_data, NULL);
-}
-
diff --git a/src/libtracker-miner/tracker-dbus.h b/src/libtracker-miner/tracker-dbus.h
index a81ef91..31a9d0e 100644
--- a/src/libtracker-miner/tracker-dbus.h
+++ b/src/libtracker-miner/tracker-dbus.h
@@ -24,17 +24,7 @@
 #error "Only <libtracker-miner/tracker-miner.h> can be included directly."
 #endif
 
-#include <libtracker-common/tracker-dbus.h>
 
-#include "tracker-miner-object.h"
-
-typedef void (* TrackerMinerDBusNameFunc)   (TrackerMiner             *miner,
-                                             const gchar              *name,
-                                             gboolean                  available);
-
-void _tracker_miner_dbus_init               (TrackerMiner             *miner,
-                                             const DBusGObjectInfo    *info);
-void _tracker_miner_dbus_shutdown           (TrackerMiner             *miner);
 
 
 #endif /* __LIBTRACKER_MINER_DBUS_H__ */
diff --git a/src/libtracker-miner/tracker-miner-web.c b/src/libtracker-miner/tracker-miner-web.c
index 578bcea..e225f55 100644
--- a/src/libtracker-miner/tracker-miner-web.c
+++ b/src/libtracker-miner/tracker-miner-web.c
@@ -19,6 +19,8 @@
 
 #include "config.h"
 
+#include <libtracker-common/tracker-dbus.h>
+
 #include "tracker-dbus.h"
 #include "tracker-miner-web.h"
 #include "tracker-miner-web-dbus.h"



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