[tracker/pushplugin] Added TrackerMiner API to push plugin, please squash me



commit 2e74d8411d8098e7865731449a5601fb62101f71
Author: Philip Van Hoof <philip codeminded be>
Date:   Mon Sep 21 18:05:05 2009 +0200

    Added TrackerMiner API to push plugin, please squash me

 src/plugins/evolution/Makefile.am                  |   24 +-
 src/plugins/evolution/tracker-evolution-plugin.c   |   26 +-
 src/plugins/evolution/tracker-evolution-plugin.h   |    6 +-
 .../evolution/tracker-evolution-registrar.c        |  902 --------------------
 .../evolution/tracker-evolution-registrar.xml      |   39 -
 5 files changed, 24 insertions(+), 973 deletions(-)
---
diff --git a/src/plugins/evolution/Makefile.am b/src/plugins/evolution/Makefile.am
index a10dfda..884f12c 100644
--- a/src/plugins/evolution/Makefile.am
+++ b/src/plugins/evolution/Makefile.am
@@ -28,29 +28,6 @@ eplugin_LTLIBRARIES = liborg-freedesktop-Tracker-evolution-plugin.la
 
 module_flags = -module -avoid-version -no-undefined
 
-pushd_modulesdir = $(libdir)/tracker-$(TRACKER_API_VERSION)/push-modules/daemon
-
-pushd_modules_LTLIBRARIES = libtracker-module-evolution-daemon-module.la
-
-libtracker_module_evolution_daemon_module_la_SOURCES =	 		\
-	tracker-evolution-registrar.c					\
-	tracker-evolution-registrar.h					\
-	tracker-evolution-common.h					\
-	tracker-evolution-registrar-glue.h
-
-libtracker_module_evolution_daemon_module_la_LDFLAGS = $(module_flags)
-
-libtracker_module_evolution_daemon_module_la_LIBADD = 			\
-	$(top_builddir)/src/libtracker-data/libtracker-data.la          \
-	$(top_builddir)/src/libtracker-db/libtracker-db.la              \
-	$(top_builddir)/src/libtracker-common/libtracker-common.la      \
-	$(GMODULE_LIBS)							\
-	$(DBUS_LIBS)                                                    \
-	$(GTHREAD_LIBS)                                                 \
-	$(GIO_LIBS)                                                     \
-	$(GLIB2_LIBS)                                                   \
-	$(GCOV_LIBS)
-
 liborg_freedesktop_Tracker_evolution_plugin_la_SOURCES = 		\
 	tracker-evolution-plugin.c 			 		\
 	tracker-evolution-plugin.h					\
@@ -60,6 +37,7 @@ liborg_freedesktop_Tracker_evolution_plugin_la_LDFLAGS = -module -avoid-version
 liborg_freedesktop_Tracker_evolution_plugin_la_LIBADD = 		\
 	$(top_builddir)/src/libtracker-client/libtracker-client- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la	\
+	$(top_builddir)/src/libtracker-miner/libtracker-miner.la	\
 	$(EVOLUTION_PLUGIN_LIBS)					\
 	$(DBUS_LIBS)							\
 	$(GCOV_LIBS)
diff --git a/src/plugins/evolution/tracker-evolution-plugin.c b/src/plugins/evolution/tracker-evolution-plugin.c
index 6aaa9d5..94ec2ea 100644
--- a/src/plugins/evolution/tracker-evolution-plugin.c
+++ b/src/plugins/evolution/tracker-evolution-plugin.c
@@ -100,7 +100,7 @@
 #define NAO_PREFIX			TRACKER_NAO_PREFIX
 #define DATASOURCE_URN			"urn:nepomuk:datasource:1cb1eb90-1241-11de-8c30-0800200c9a66"
 
-G_DEFINE_TYPE (TrackerEvolutionPlugin, tracker_evolution_plugin, G_TYPE_OBJECT)
+G_DEFINE_TYPE (TrackerEvolutionPlugin, tracker_evolution_plugin, TRACKER_TYPE_MINER)
 
 #define TRACKER_EVOLUTION_PLUGIN_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_EVOLUTION_PLUGIN, TrackerEvolutionPluginPrivate))
 
@@ -175,10 +175,6 @@ typedef struct {
 	CamelFolderInfo *iter;
 } TryAgainInfo;
 
-enum {
-	PROP_0,
-	PROP_CONNECTION
-};
 
 static GQueue *many_queue = NULL;
 static DBusGProxy *dbus_proxy = NULL;
@@ -2029,7 +2025,7 @@ enable_plugin (void)
 	client = tracker_connect (FALSE, G_MAXINT);
 
 	manager = g_object_new (TRACKER_TYPE_EVOLUTION_PLUGIN, 
-	                        "connection", connection, NULL);
+	                        "name", "Emails", NULL);
 
 	dbus_proxy = dbus_g_proxy_new_for_name (connection, 
 	                                        DBUS_SERVICE_DBUS,
@@ -2120,6 +2116,7 @@ tracker_evolution_plugin_init (TrackerEvolutionPlugin *plugin)
 {
 	TrackerEvolutionPluginPrivate *priv = TRACKER_EVOLUTION_PLUGIN_GET_PRIVATE (plugin);
 	EIterator *it;
+	gdouble length, step = 0;
 
 	priv->mutex = g_slice_new0 (GStaticRecMutex);
 	g_static_rec_mutex_init (priv->mutex);
@@ -2135,8 +2132,23 @@ tracker_evolution_plugin_init (TrackerEvolutionPlugin *plugin)
 
 	priv->accounts = g_object_ref (mail_config_get_accounts ());
 
-	for (it = e_list_get_iterator (E_LIST (priv->accounts)); e_iterator_is_valid (it); e_iterator_next (it))
+	length = (gdouble) e_list_length (E_LIST (priv->accounts));
+
+	g_object_set (plugin, 
+	              "progress", 0.0, 
+	              "status", _("Initializing"),
+	              NULL);
+
+	for (it = e_list_get_iterator (E_LIST (priv->accounts)); e_iterator_is_valid (it); e_iterator_next (it)) {
+
+		g_object_set (plugin, 
+		              "progress", (((gdouble) (length * step)) / ((gdouble) 100)), 
+		              "status", _("Initializing"),
+		              NULL);
+
 		register_account (plugin, (EAccount *) e_iterator_get (it));
+		step++;
+	}
 
 	g_object_unref (it);
 
diff --git a/src/plugins/evolution/tracker-evolution-plugin.h b/src/plugins/evolution/tracker-evolution-plugin.h
index 0494843..c8f43a1 100644
--- a/src/plugins/evolution/tracker-evolution-plugin.h
+++ b/src/plugins/evolution/tracker-evolution-plugin.h
@@ -27,6 +27,8 @@
 #include <dbus/dbus-glib-bindings.h>
 #include <dbus/dbus-glib-lowlevel.h>
 
+#include <libtracker-miner/tracker-miner.h>
+
 #include "tracker-evolution-common.h"
 
 #define TRACKER_TYPE_EVOLUTION_PLUGIN          (tracker_evolution_plugin_get_type())
@@ -40,11 +42,11 @@ typedef struct TrackerEvolutionPlugin TrackerEvolutionPlugin;
 typedef struct TrackerEvolutionPluginClass TrackerEvolutionPluginClass;
 
 struct TrackerEvolutionPlugin {
-	GObject parent;
+	TrackerMiner parent;
 };
 
 struct TrackerEvolutionPluginClass {
-	GObjectClass parent;
+	TrackerMinerClass parent;
 };
 
 GType tracker_evolution_plugin_get_type (void);



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