[tracker/miner-fs-dbus-api: 4/13] TrackerMinerManager: Add method to invoke tracker-miner-fs to index a file.



commit 73e9288997e8f70c34bc5f592972d643bd5353a5
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Aug 19 15:04:57 2010 +0200

    TrackerMinerManager: Add method to invoke tracker-miner-fs to index a file.

 src/libtracker-miner/Makefile.am             |    1 +
 src/libtracker-miner/tracker-miner-manager.c |   27 ++++++++++++++++++++++++++
 src/libtracker-miner/tracker-miner-manager.h |    4 +++
 3 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-miner/Makefile.am b/src/libtracker-miner/Makefile.am
index e71f8cd..2092292 100644
--- a/src/libtracker-miner/Makefile.am
+++ b/src/libtracker-miner/Makefile.am
@@ -106,6 +106,7 @@ $(top_builddir)/src/libtracker-miner/tracker-marshal.c: tracker-marshal.list
 dbus_sources = 						\
 	tracker-miner-glue.h				\
 	tracker-miner-web-glue.h			\
+	tracker-miner-files-index-client.h		\
 	tracker-miner-client.h
 
 %-glue.h: $(top_srcdir)/data/dbus/%.xml
diff --git a/src/libtracker-miner/tracker-miner-manager.c b/src/libtracker-miner/tracker-miner-manager.c
index 188bb17..c8f00a3 100644
--- a/src/libtracker-miner/tracker-miner-manager.c
+++ b/src/libtracker-miner/tracker-miner-manager.c
@@ -27,6 +27,7 @@
 #include "tracker-miner-manager.h"
 #include "tracker-marshal.h"
 #include "tracker-miner-client.h"
+#include "tracker-miner-files-index-client.h"
 #include "tracker-miner-dbus.h"
 
 /**
@@ -980,3 +981,29 @@ tracker_miner_manager_ignore_next_update (TrackerMinerManager *manager,
 
 	return TRUE;
 }
+
+void
+tracker_miner_manager_index_file (TrackerMinerManager  *manager,
+                                  GFile                *file,
+                                  GError              **error)
+{
+	static DBusGProxy *proxy = NULL;
+	TrackerMinerManagerPrivate *priv;
+	gchar *uri;
+
+	g_return_if_fail (TRACKER_IS_MINER_MANAGER (manager));
+	g_return_if_fail (G_IS_FILE (file));
+
+	priv = TRACKER_MINER_MANAGER_GET_PRIVATE (manager);
+
+	if (G_UNLIKELY (!proxy)) {
+		proxy = dbus_g_proxy_new_for_name (priv->connection,
+		                                   "org.freedesktop.Tracker1.Miner.Files.Index",
+		                                   "/org/freedesktop/Tracker1/Miner/Files/Index",
+		                                   "org.freedesktop.Tracker1.Miner.Files.Index");
+	}
+
+	uri = g_file_get_uri (file);
+	org_freedesktop_Tracker1_Miner_Files_Index_index_files (proxy, uri, error);
+	g_free (uri);
+}
diff --git a/src/libtracker-miner/tracker-miner-manager.h b/src/libtracker-miner/tracker-miner-manager.h
index 97cc013..9e707d4 100644
--- a/src/libtracker-miner/tracker-miner-manager.h
+++ b/src/libtracker-miner/tracker-miner-manager.h
@@ -99,6 +99,10 @@ const gchar *        tracker_miner_manager_get_display_name   (TrackerMinerManag
 const gchar *        tracker_miner_manager_get_description    (TrackerMinerManager  *manager,
                                                                const gchar          *miner);
 
+void                 tracker_miner_manager_index_file         (TrackerMinerManager  *manager,
+                                                               GFile                *file,
+                                                               GError              **error);
+
 G_END_DECLS
 
 #endif /* __LIBTRACKER_MINER_MANAGER_H__ */



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