[tracker] tracker-store: Renamed TrackerBusyNotifier to TrackerStatus



commit e410e138a6bf13cd67a2ebf200be99fe7d69c27c
Author: Philip Van Hoof <philip codeminded be>
Date:   Tue Mar 30 11:19:43 2010 +0200

    tracker-store: Renamed TrackerBusyNotifier to TrackerStatus
    
    Rename requested by Martyn

 data/dbus/Makefile.am                              |    2 +-
 ...racker-busy-notifier.xml => tracker-status.xml} |    2 +-
 src/tracker-store/Makefile.am                      |    6 +-
 src/tracker-store/tracker-backup.c                 |    8 +-
 src/tracker-store/tracker-busy-notifier.h          |   74 --------------------
 src/tracker-store/tracker-dbus.c                   |   20 +++---
 src/tracker-store/tracker-dbus.h                   |   14 ++--
 src/tracker-store/tracker-main.c                   |    8 +-
 .../{tracker-busy-notifier.c => tracker-status.c}  |   74 ++++++++++----------
 src/tracker-store/tracker-status.h                 |   74 ++++++++++++++++++++
 10 files changed, 141 insertions(+), 141 deletions(-)
---
diff --git a/data/dbus/Makefile.am b/data/dbus/Makefile.am
index 13acf5c..64a6f7c 100644
--- a/data/dbus/Makefile.am
+++ b/data/dbus/Makefile.am
@@ -11,7 +11,7 @@ config_DATA =							\
 	tracker-resources-class.xml				\
 	tracker-statistics.xml					\
 	tracker-writeback.xml					\
-	tracker-busy-notifier.xml
+	tracker-status.xml
 
 config_noinst = 						\
 	tracker-miner-files-reindex.xml
diff --git a/data/dbus/tracker-busy-notifier.xml b/data/dbus/tracker-status.xml
similarity index 90%
rename from data/dbus/tracker-busy-notifier.xml
rename to data/dbus/tracker-status.xml
index f50056b..ffc0bad 100644
--- a/data/dbus/tracker-busy-notifier.xml
+++ b/data/dbus/tracker-status.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 <node name="/">
-  <interface name="org.freedesktop.Tracker1.BusyNotifier">
+  <interface name="org.freedesktop.Tracker1.Status">
 
    <method name="GetStatus">
       <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
diff --git a/src/tracker-store/Makefile.am b/src/tracker-store/Makefile.am
index b146bec..3481179 100644
--- a/src/tracker-store/Makefile.am
+++ b/src/tracker-store/Makefile.am
@@ -50,8 +50,8 @@ tracker_store_SOURCES =							\
 	tracker-statistics.h						\
 	tracker-store.c							\
 	tracker-store.h							\
-	tracker-busy-notifier.c						\
-	tracker-busy-notifier.h
+	tracker-status.c						\
+	tracker-status.h
 
 if OS_WIN32
 tracker_store_win_libs = -lws2_32 -lkernel32
@@ -84,7 +84,7 @@ dbus_sources = 								\
 	tracker-resources-glue.h					\
 	tracker-statistics-glue.h					\
 	tracker-resources-class-glue.h					\
-	tracker-busy-notifier-glue.h
+	tracker-status-glue.h
 
 tracker-marshal.h: tracker-marshal.list
 	$(AM_V_GEN)$(GLIB_GENMARSHAL) $< --prefix=tracker_marshal --header > $@
diff --git a/src/tracker-store/tracker-backup.c b/src/tracker-store/tracker-backup.c
index e25cc95..106caa4 100644
--- a/src/tracker-store/tracker-backup.c
+++ b/src/tracker-store/tracker-backup.c
@@ -112,7 +112,7 @@ backup_idle (gpointer user_data)
 {
 	TrackerDBusMethodInfo *info = user_data;
 	GFile *journal;
-	TrackerBusyNotifier *notifier;
+	TrackerStatus *notifier;
 	TrackerBusyCallback busy_callback;
 	gpointer busy_user_data;
 
@@ -120,10 +120,10 @@ backup_idle (gpointer user_data)
 
 	tracker_dbus_set_available (FALSE);
 
-	notifier = TRACKER_BUSY_NOTIFIER (tracker_dbus_get_object (TRACKER_TYPE_BUSY_NOTIFIER));
+	notifier = TRACKER_STATUS (tracker_dbus_get_object (TRACKER_TYPE_STATUS));
 
-	busy_callback = tracker_busy_notifier_get_callback (notifier, 
-	                                                    &busy_user_data);
+	busy_callback = tracker_status_get_callback (notifier, 
+	                                            &busy_user_data);
 
 	g_free (info->journal_uri);
 
diff --git a/src/tracker-store/tracker-dbus.c b/src/tracker-store/tracker-dbus.c
index 91ccbc3..440c48e 100644
--- a/src/tracker-store/tracker-dbus.c
+++ b/src/tracker-store/tracker-dbus.c
@@ -35,8 +35,8 @@
 #include "tracker-resources-glue.h"
 #include "tracker-resource-class.h"
 #include "tracker-resources-class-glue.h"
-#include "tracker-busy-notifier.h"
-#include "tracker-busy-notifier-glue.h"
+#include "tracker-status.h"
+#include "tracker-status-glue.h"
 #include "tracker-statistics.h"
 #include "tracker-statistics-glue.h"
 #include "tracker-backup.h"
@@ -46,7 +46,7 @@
 static DBusGConnection *connection;
 static DBusGProxy      *gproxy;
 static GSList          *objects;
-TrackerBusyNotifier    *notifier = NULL;
+TrackerStatus          *notifier = NULL;
 TrackerBackup          *backup = NULL;
 
 static gboolean
@@ -219,8 +219,8 @@ name_owner_changed_closure (gpointer  data,
 {
 }
 
-TrackerBusyNotifier*
-tracker_dbus_register_busy_notifier (void)
+TrackerStatus*
+tracker_dbus_register_notifier (void)
 {
 	if (!connection || !gproxy) {
 		g_critical ("D-Bus support must be initialized before registering objects!");
@@ -228,17 +228,17 @@ tracker_dbus_register_busy_notifier (void)
 	}
 
 	/* Add org.freedesktop.Tracker */
-	notifier = tracker_busy_notifier_new ();
+	notifier = tracker_status_new ();
 	if (!notifier) {
-		g_critical ("Could not create TrackerBusyNotifier object to register");
+		g_critical ("Could not create TrackerStatus object to register");
 		return FALSE;
 	}
 
 	dbus_register_object (connection,
 	                      gproxy,
 	                      G_OBJECT (notifier),
-	                      &dbus_glib_tracker_busy_notifier_object_info,
-	                      TRACKER_BUSY_NOTIFIER_PATH);
+	                      &dbus_glib_tracker_status_object_info,
+	                      TRACKER_STATUS_PATH);
 
 	return g_object_ref (notifier);
 }
@@ -407,7 +407,7 @@ tracker_dbus_get_object (GType type)
 		}
 	}
 
-	if (notifier && type == TRACKER_TYPE_BUSY_NOTIFIER) {
+	if (notifier && type == TRACKER_TYPE_STATUS) {
 		return G_OBJECT (notifier);
 	}
 
diff --git a/src/tracker-store/tracker-dbus.h b/src/tracker-store/tracker-dbus.h
index 93a0c96..111ee86 100644
--- a/src/tracker-store/tracker-dbus.h
+++ b/src/tracker-store/tracker-dbus.h
@@ -25,16 +25,16 @@
 
 #include <dbus/dbus-glib-bindings.h>
 
-#include "tracker-busy-notifier.h"
+#include "tracker-status.h"
 
 G_BEGIN_DECLS
 
-gboolean             tracker_dbus_init                    (void);
-void                 tracker_dbus_shutdown                (void);
-gboolean             tracker_dbus_register_objects        (void);
-GObject             *tracker_dbus_get_object              (GType type);
-TrackerBusyNotifier *tracker_dbus_register_busy_notifier  (void);
-void                 tracker_dbus_set_available           (gboolean available);
+gboolean        tracker_dbus_init                    (void);
+void            tracker_dbus_shutdown                (void);
+gboolean        tracker_dbus_register_objects        (void);
+GObject        *tracker_dbus_get_object              (GType type);
+TrackerStatus  *tracker_dbus_register_notifier       (void);
+void            tracker_dbus_set_available           (gboolean available);
 
 G_END_DECLS
 
diff --git a/src/tracker-store/tracker-main.c b/src/tracker-store/tracker-main.c
index dccb6dc..962ddcd 100644
--- a/src/tracker-store/tracker-main.c
+++ b/src/tracker-store/tracker-main.c
@@ -336,7 +336,7 @@ main (gint argc, gchar *argv[])
 	TrackerConfig *config;
 	TrackerDBManagerFlags flags = 0;
 	gboolean is_first_time_index;
-	TrackerBusyNotifier *notifier;
+	TrackerStatus *notifier;
 	gpointer busy_user_data;
 	TrackerBusyCallback busy_callback;
 
@@ -447,9 +447,9 @@ main (gint argc, gchar *argv[])
 		flags |= TRACKER_DB_MANAGER_LOW_MEMORY_MODE;
 	}
 
-	notifier = tracker_dbus_register_busy_notifier ();
-	busy_callback = tracker_busy_notifier_get_callback (notifier, 
-	                                                    &busy_user_data);
+	notifier = tracker_dbus_register_notifier ();
+	busy_callback = tracker_status_get_callback (notifier, 
+	                                            &busy_user_data);
 
 	if (!tracker_data_manager_init (flags,
 	                                NULL,
diff --git a/src/tracker-store/tracker-busy-notifier.c b/src/tracker-store/tracker-status.c
similarity index 61%
rename from src/tracker-store/tracker-busy-notifier.c
rename to src/tracker-store/tracker-status.c
index 2f8030b..d325a50 100644
--- a/src/tracker-store/tracker-busy-notifier.c
+++ b/src/tracker-store/tracker-status.c
@@ -27,10 +27,10 @@
 #include <libtracker-common/tracker-dbus.h>
 
 #include "tracker-dbus.h"
-#include "tracker-busy-notifier.h"
+#include "tracker-status.h"
 #include "tracker-marshal.h"
 
-#define TRACKER_BUSY_NOTIFIER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_BUSY_NOTIFIER, TrackerBusyNotifierPrivate))
+#define TRACKER_STATUS_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_STATUS, TrackerStatusPrivate))
 
 #define PROGRESS_TIMEOUT_S 5
 
@@ -38,43 +38,43 @@ typedef struct {
 	gdouble progress;
 	gchar *status;
 	guint timer_id;
-	TrackerBusyNotifier *object;
-} TrackerBusyNotifierPrivate;
+	TrackerStatus *object;
+} TrackerStatusPrivate;
 
 enum {
 	PROGRESS,
 	LAST_SIGNAL
 };
 
-static void tracker_busy_notifier_finalize (GObject *object);
+static void tracker_status_finalize (GObject *object);
 
-G_DEFINE_TYPE(TrackerBusyNotifier, tracker_busy_notifier, G_TYPE_OBJECT)
+G_DEFINE_TYPE(TrackerStatus, tracker_status, G_TYPE_OBJECT)
 
 static guint signals[LAST_SIGNAL] = {0};
 
 
-TrackerBusyNotifier *
-tracker_busy_notifier_new (void)
+TrackerStatus *
+tracker_status_new (void)
 {
-	return g_object_new (TRACKER_TYPE_BUSY_NOTIFIER, NULL);
+	return g_object_new (TRACKER_TYPE_STATUS, NULL);
 }
 
 static void
-tracker_busy_notifier_class_init (TrackerBusyNotifierClass *klass)
+tracker_status_class_init (TrackerStatusClass *klass)
 {
 	GObjectClass *object_class;
 
 	object_class = G_OBJECT_CLASS (klass);
 
-	object_class->finalize = tracker_busy_notifier_finalize;
+	object_class->finalize = tracker_status_finalize;
 
 	/**
-	 * TrackerBusyNotifier::progress:
-	 * @notifier: the TrackerBusyNotifier
+	 * TrackerStatus::progress:
+	 * @notifier: the TrackerStatus
 	 * @status: store status
 	 * @progress: a #gdouble indicating store progress, from 0 to 1.
 	 *
-	 * the ::progress signal will be emitted by TrackerBusyNotifier
+	 * the ::progress signal will be emitted by TrackerStatus
 	 * to indicate progress about the store process. @status will
 	 * contain a translated string with the current status and @progress
 	 * will indicate how much has been processed so far.
@@ -83,21 +83,21 @@ tracker_busy_notifier_class_init (TrackerBusyNotifierClass *klass)
 		g_signal_new ("progress",
 		              G_OBJECT_CLASS_TYPE (object_class),
 		              G_SIGNAL_RUN_LAST,
-		              G_STRUCT_OFFSET (TrackerBusyNotifierClass, progress),
+		              G_STRUCT_OFFSET (TrackerStatusClass, progress),
 		              NULL, NULL,
 		              tracker_marshal_VOID__STRING_DOUBLE,
 		              G_TYPE_NONE, 2,
 		              G_TYPE_STRING,
 		              G_TYPE_DOUBLE);
 
-	g_type_class_add_private (object_class, sizeof (TrackerBusyNotifierPrivate));
+	g_type_class_add_private (object_class, sizeof (TrackerStatusPrivate));
 }
 
 
 static void
-tracker_busy_notifier_finalize (GObject *object)
+tracker_status_finalize (GObject *object)
 {
-	TrackerBusyNotifierPrivate *priv = TRACKER_BUSY_NOTIFIER_GET_PRIVATE (object);
+	TrackerStatusPrivate *priv = TRACKER_STATUS_GET_PRIVATE (object);
 	if (priv->timer_id != 0)
 		g_source_remove (priv->timer_id);
 	g_free (priv->status);
@@ -105,9 +105,9 @@ tracker_busy_notifier_finalize (GObject *object)
 
 
 static void
-tracker_busy_notifier_init (TrackerBusyNotifier *object)
+tracker_status_init (TrackerStatus *object)
 {
-	TrackerBusyNotifierPrivate *priv = TRACKER_BUSY_NOTIFIER_GET_PRIVATE (object);
+	TrackerStatusPrivate *priv = TRACKER_STATUS_GET_PRIVATE (object);
 
 	priv->object = object;
 	priv->timer_id = 0;
@@ -116,7 +116,7 @@ tracker_busy_notifier_init (TrackerBusyNotifier *object)
 static gboolean
 busy_notification_timeout (gpointer user_data)
 {
-	TrackerBusyNotifierPrivate *priv = user_data;
+	TrackerStatusPrivate *priv = user_data;
 
 	g_signal_emit (priv->object, signals[PROGRESS], 0,
 	               priv->status,
@@ -128,19 +128,19 @@ busy_notification_timeout (gpointer user_data)
 static void
 busy_notification_destroy (gpointer user_data)
 {
-	TrackerBusyNotifierPrivate *priv = user_data;
+	TrackerStatusPrivate *priv = user_data;
 
 	priv->timer_id = 0;
 }
 
 
 static void
-tracker_busy_notifier_callback (const gchar *status,
-                                gdouble progress,
-                                gpointer user_data)
+tracker_status_callback (const gchar *status,
+                         gdouble progress,
+                         gpointer user_data)
 {
 	static gboolean first_time = TRUE;
-	TrackerBusyNotifierPrivate *priv = user_data;
+	TrackerStatusPrivate *priv = user_data;
 	priv->progress = progress;
 
 	if (g_strcmp0 (status, priv->status) != 0) {
@@ -168,19 +168,19 @@ tracker_busy_notifier_callback (const gchar *status,
 }
 
 TrackerBusyCallback
-tracker_busy_notifier_get_callback (TrackerBusyNotifier *object, gpointer *user_data)
+tracker_status_get_callback (TrackerStatus *object, gpointer *user_data)
 {
-	TrackerBusyNotifierPrivate *priv = TRACKER_BUSY_NOTIFIER_GET_PRIVATE (object);
+	TrackerStatusPrivate *priv = TRACKER_STATUS_GET_PRIVATE (object);
 	*user_data = priv;
-	return tracker_busy_notifier_callback;
+	return tracker_status_callback;
 }
 
 void 
-tracker_busy_notifier_get_progress  (TrackerBusyNotifier    *object,
-                                     DBusGMethodInvocation  *context,
-                                     GError                **error)
+tracker_status_get_progress  (TrackerStatus    *object,
+                              DBusGMethodInvocation  *context,
+                              GError                **error)
 {
-	TrackerBusyNotifierPrivate *priv = TRACKER_BUSY_NOTIFIER_GET_PRIVATE (object);
+	TrackerStatusPrivate *priv = TRACKER_STATUS_GET_PRIVATE (object);
 	guint request_id;
 
 	request_id = tracker_dbus_get_next_request_id ();
@@ -192,11 +192,11 @@ tracker_busy_notifier_get_progress  (TrackerBusyNotifier    *object,
 
 
 void 
-tracker_busy_notifier_get_status  (TrackerBusyNotifier    *object,
-                                   DBusGMethodInvocation  *context,
-                                   GError                **error)
+tracker_status_get_status  (TrackerStatus    *object,
+                            DBusGMethodInvocation  *context,
+                            GError                **error)
 {
-	TrackerBusyNotifierPrivate *priv = TRACKER_BUSY_NOTIFIER_GET_PRIVATE (object);
+	TrackerStatusPrivate *priv = TRACKER_STATUS_GET_PRIVATE (object);
 	guint request_id;
 
 	request_id = tracker_dbus_get_next_request_id ();
diff --git a/src/tracker-store/tracker-status.h b/src/tracker-store/tracker-status.h
new file mode 100644
index 0000000..3c53199
--- /dev/null
+++ b/src/tracker-store/tracker-status.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2008, Nokia
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ *
+ * Authors:
+ *  Philip Van Hoof <philip codeminded be>
+ */
+
+#ifndef __TRACKER_STORE_STATUS_H__
+#define __TRACKER_STORE_STATUS_H__
+
+#include <glib-object.h>
+#include <libtracker-common/tracker-dbus.h>
+#include <libtracker-data/tracker-data-update.h>
+
+#define TRACKER_STATUS_SERVICE         "org.freedesktop.Tracker1"
+#define TRACKER_STATUS_PATH            "/org/freedesktop/Tracker1/Status"
+#define TRACKER_STATUS_INTERFACE       "org.freedesktop.Tracker1.Status"
+
+G_BEGIN_DECLS
+
+#define TRACKER_TYPE_STATUS            (tracker_status_get_type ())
+#define TRACKER_STATUS(object)         (G_TYPE_CHECK_INSTANCE_CAST ((object), TRACKER_TYPE_STATUS, TrackerStatus))
+#define TRACKER_STATUS_CLASS(klass)    (G_TYPE_CHECK_NOTIFIER_CAST ((klass), TRACKER_TYPE_STATUS, TrackerStatusClass))
+#define TRACKER_IS_STATUS(object)      (G_TYPE_CHECK_INSTANCE_TYPE ((object), TRACKER_TYPE_STATUS))
+#define TRACKER_IS_STATUS_CLASS(klass) (G_TYPE_CHECK_NOTIFIER_TYPE ((klass), TRACKER_TYPE_STATUS))
+#define TRACKER_STATUS_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_NOTIFIER ((obj), TRACKER_TYPE_STATUS, TrackerStatusClass))
+
+typedef struct TrackerStatus       TrackerStatus;
+typedef struct TrackerStatusClass TrackerStatusClass;
+
+struct TrackerStatus {
+	GObject parent;
+};
+
+struct TrackerStatusClass {
+	GObjectClass parent;
+
+	void (* progress) (TrackerStatus       *notifier,
+	                   const gchar         *status,
+	                   gdouble              progress);
+};
+
+GType                 tracker_status_get_type      (void);
+TrackerStatus        *tracker_status_new           (void);
+TrackerBusyCallback   tracker_status_get_callback  (TrackerStatus          *object,
+                                                    gpointer               *user_data);
+
+/* DBus methods */
+void                  tracker_status_get_progress  (TrackerStatus          *object,
+                                                    DBusGMethodInvocation  *context,
+                                                    GError                **error);
+void                  tracker_status_get_status    (TrackerStatus          *object,
+                                                    DBusGMethodInvocation  *context,
+                                                    GError                **error);
+
+
+G_END_DECLS
+
+#endif /* __TRACKER_STORE_STATUS_H__ */



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