[tracker/miner-web-review: 8/74] libtracker-miner: Moved tracker-storage here from libtracker-common



commit c34a36a770bb0695fe7a9ed3211e82535597ab66
Author: Martyn Russell <martyn lanedo com>
Date:   Tue Feb 23 09:54:39 2010 +0000

    libtracker-miner: Moved tracker-storage here from libtracker-common

 .../libtracker-common/libtracker-common-docs.sgml  |    2 -
 .../libtracker-common-sections.txt                 |   23 -------------------
 .../libtracker-miner/libtracker-miner-docs.sgml    |    6 +++++
 .../libtracker-miner/libtracker-miner-sections.txt |   23 +++++++++++++++++++
 src/libtracker-common/Makefile.am                  |   10 --------
 src/libtracker-miner/Makefile.am                   |    5 +++-
 src/libtracker-miner/tracker-marshal.list          |    1 +
 .../tracker-storage.c}                             |    4 ++-
 .../tracker-storage.h                              |    0
 src/tracker-extract/Makefile.am                    |    1 +
 src/tracker-extract/tracker-albumart.c             |   24 ++++++++++----------
 src/tracker-miner-fs/tracker-miner-files.c         |    2 +-
 12 files changed, 51 insertions(+), 50 deletions(-)
---
diff --git a/docs/reference/libtracker-common/libtracker-common-docs.sgml b/docs/reference/libtracker-common/libtracker-common-docs.sgml
index 41e2554..b559588 100644
--- a/docs/reference/libtracker-common/libtracker-common-docs.sgml
+++ b/docs/reference/libtracker-common/libtracker-common-docs.sgml
@@ -15,7 +15,6 @@
 <!ENTITY tracker-os-dependant SYSTEM "xml/tracker-os-dependant.xml">
 <!ENTITY tracker-power SYSTEM "xml/tracker-power.xml">
 <!ENTITY tracker-property SYSTEM "xml/tracker-property.xml">
-<!ENTITY tracker-storage SYSTEM "xml/tracker-storage.xml">
 <!ENTITY tracker-type-utils SYSTEM "xml/tracker-type-utils.xml">
 <!ENTITY tracker-utils SYSTEM "xml/tracker-utils.xml">
 <!ENTITY version SYSTEM "version.xml">
@@ -52,7 +51,6 @@
       &tracker-config-file;
       &tracker-language;
       &tracker-power;
-      &tracker-storage;
     </chapter>
 
     <chapter>
diff --git a/docs/reference/libtracker-common/libtracker-common-sections.txt b/docs/reference/libtracker-common/libtracker-common-sections.txt
index 597bf04..a7462e8 100644
--- a/docs/reference/libtracker-common/libtracker-common-sections.txt
+++ b/docs/reference/libtracker-common/libtracker-common-sections.txt
@@ -41,29 +41,6 @@ TRACKER_CLASS_GET_CLASS
 </SECTION>
 
 <SECTION>
-<FILE>tracker-storage</FILE>
-<TITLE>TrackerStorage</TITLE>
-TrackerStorage
-TrackerStorageClass
-tracker_storage_new
-tracker_storage_get_mounted_directory_roots
-tracker_storage_get_removable_device_roots
-tracker_storage_get_removable_device_udis
-tracker_storage_udi_get_mount_point
-tracker_storage_udi_get_is_mounted
-tracker_storage_uri_is_on_removable_device
-tracker_storage_get_volume_udi_for_file
-<SUBSECTION Standard>
-TRACKER_STORAGE
-TRACKER_IS_STORAGE
-TRACKER_TYPE_STORAGE
-tracker_storage_get_type
-TRACKER_STORAGE_CLASS
-TRACKER_IS_STORAGE_CLASS
-TRACKER_STORAGE_GET_CLASS
-</SECTION>
-
-<SECTION>
 <FILE>tracker-power</FILE>
 <TITLE>TrackerPower</TITLE>
 TrackerPower
diff --git a/docs/reference/libtracker-miner/libtracker-miner-docs.sgml b/docs/reference/libtracker-miner/libtracker-miner-docs.sgml
index aa533ea..bfe9175 100644
--- a/docs/reference/libtracker-miner/libtracker-miner-docs.sgml
+++ b/docs/reference/libtracker-miner/libtracker-miner-docs.sgml
@@ -4,6 +4,7 @@
 <!ENTITY tracker-miner SYSTEM "xml/tracker-miner.xml">
 <!ENTITY tracker-miner-fs SYSTEM "xml/tracker-miner-fs.xml">
 <!ENTITY tracker-miner-manager SYSTEM "xml/tracker-miner-manager.xml">
+<!ENTITY tracker-storage SYSTEM "xml/tracker-storage.xml">
 <!ENTITY version SYSTEM "version.xml">
 ]>
 <book id="index">
@@ -39,4 +40,9 @@
       <title>Managing miners</title>
       &tracker-miner-manager;
     </chapter>
+
+    <chapter>
+      <title>Utilities</title>
+      &tracker-storage;
+    </chapter>
 </book>
diff --git a/docs/reference/libtracker-miner/libtracker-miner-sections.txt b/docs/reference/libtracker-miner/libtracker-miner-sections.txt
index c764f10..b511b16 100644
--- a/docs/reference/libtracker-miner/libtracker-miner-sections.txt
+++ b/docs/reference/libtracker-miner/libtracker-miner-sections.txt
@@ -108,3 +108,26 @@ tracker_thumbnailer_remove_add
 tracker_thumbnailer_cleanup
 </SECTION>
 
+<SECTION>
+<FILE>tracker-storage</FILE>
+<TITLE>TrackerStorage</TITLE>
+TrackerStorage
+TrackerStorageClass
+tracker_storage_new
+tracker_storage_get_mounted_directory_roots
+tracker_storage_get_removable_device_roots
+tracker_storage_get_removable_device_udis
+tracker_storage_udi_get_mount_point
+tracker_storage_udi_get_is_mounted
+tracker_storage_uri_is_on_removable_device
+tracker_storage_get_volume_udi_for_file
+<SUBSECTION Standard>
+TRACKER_STORAGE
+TRACKER_IS_STORAGE
+TRACKER_TYPE_STORAGE
+tracker_storage_get_type
+TRACKER_STORAGE_CLASS
+TRACKER_IS_STORAGE_CLASS
+TRACKER_STORAGE_GET_CLASS
+</SECTION>
+
diff --git a/src/libtracker-common/Makefile.am b/src/libtracker-common/Makefile.am
index 479dc1b..1cc804e 100644
--- a/src/libtracker-common/Makefile.am
+++ b/src/libtracker-common/Makefile.am
@@ -27,14 +27,6 @@ else
 os_sources = tracker-os-dependant-unix.c
 endif
 
-# For storage, we need HAL, tracker isn't yet ported to DeviceKit-disks
-if HAVE_HAL
-storage_headers =					\
-	tracker-storage.h
-storage_sources =					\
-	tracker-storage-hal.c
-endif
-
 # Prefer DeviceKit-power for the power data if it's available, else fall back to HAL
 if HAVE_DEVKIT_POWER
 power_headers =						\
@@ -57,7 +49,6 @@ libtracker_common_la_SOURCES =	 			\
 	$(marshal_sources)				\
 	$(os_sources)					\
 	$(power_sources)				\
-	$(storage_sources)				\
 	tracker-config-file.c				\
 	tracker-class.c					\
 	tracker-date-time.c				\
@@ -79,7 +70,6 @@ libtracker_common_la_SOURCES =	 			\
 
 noinst_HEADERS =					\
 	$(power_headers)				\
-	$(storage_headers)				\
 	tracker-dbus.h					\
 	tracker-ioprio.h				\
 	tracker-log.h					\
diff --git a/src/libtracker-miner/Makefile.am b/src/libtracker-miner/Makefile.am
index 973126a..75752ef 100644
--- a/src/libtracker-miner/Makefile.am
+++ b/src/libtracker-miner/Makefile.am
@@ -40,6 +40,8 @@ libtracker_miner_ TRACKER_API_VERSION@_la_SOURCES = 	\
 	tracker-miner-manager.h				\
 	tracker-monitor.c				\
 	tracker-monitor.h				\
+	tracker-storage.c				\
+	tracker-storage.h				\
 	tracker-utils.c					\
 	tracker-utils.h					\
 	tracker-thumbnailer.c
@@ -50,10 +52,11 @@ libtracker_minerinclude_HEADERS = 			\
 	tracker-miner-dbus.h 				\
 	tracker-miner-fs.h				\
 	tracker-miner-manager.h				\
+	tracker-storage.h				\
 	tracker-thumbnailer.h
 
 libtracker_miner_ TRACKER_API_VERSION@_la_LDFLAGS = 	\
-	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
+	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \m
 	-export-symbols-regex '^tracker_(miner|thumbnailer|crawler)_.*'
 
 libtracker_miner_ TRACKER_API_VERSION@_la_LIBADD = 	\
diff --git a/src/libtracker-miner/tracker-marshal.list b/src/libtracker-miner/tracker-marshal.list
index 5b5988c..05c6728 100644
--- a/src/libtracker-miner/tracker-marshal.list
+++ b/src/libtracker-miner/tracker-marshal.list
@@ -4,6 +4,7 @@ VOID:OBJECT,POINTER,UINT,UINT,UINT,UINT
 VOID:DOUBLE,UINT,UINT,UINT,UINT
 VOID:STRING,STRING,DOUBLE
 VOID:STRING,DOUBLE
+VOID:STRING,STRING
 BOOL:OBJECT,OBJECT,OBJECT
 BOOL:OBJECT,OBJECT
 BOOL:OBJECT,POINTER
diff --git a/src/libtracker-common/tracker-storage-hal.c b/src/libtracker-miner/tracker-storage.c
similarity index 99%
rename from src/libtracker-common/tracker-storage-hal.c
rename to src/libtracker-miner/tracker-storage.c
index 32822bd..430d5d6 100644
--- a/src/libtracker-common/tracker-storage-hal.c
+++ b/src/libtracker-miner/tracker-storage.c
@@ -25,12 +25,14 @@
 #include <string.h>
 
 #include <gio/gio.h>
+
 #include <libhal.h>
 #include <libhal-storage.h>
 
 #include <dbus/dbus-glib-lowlevel.h>
 
-#include "tracker-log.h"
+#include <libtracker-common/tracker-log.h>
+
 #include "tracker-storage.h"
 #include "tracker-utils.h"
 #include "tracker-marshal.h"
diff --git a/src/libtracker-common/tracker-storage.h b/src/libtracker-miner/tracker-storage.h
similarity index 100%
rename from src/libtracker-common/tracker-storage.h
rename to src/libtracker-miner/tracker-storage.h
diff --git a/src/tracker-extract/Makefile.am b/src/tracker-extract/Makefile.am
index 6da0106..1f6f5d9 100644
--- a/src/tracker-extract/Makefile.am
+++ b/src/tracker-extract/Makefile.am
@@ -329,6 +329,7 @@ tracker_extract_SOURCES = 						\
 
 tracker_extract_LDADD = 						\
 	$(top_builddir)/src/libtracker-client/libtracker-client- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-miner/libtracker-miner- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la	\
 	$(DBUS_LIBS)							\
 	$(GMODULE_LIBS)							\
diff --git a/src/tracker-extract/tracker-albumart.c b/src/tracker-extract/tracker-albumart.c
index ec4fbbc..fc17b34 100644
--- a/src/tracker-extract/tracker-albumart.c
+++ b/src/tracker-extract/tracker-albumart.c
@@ -33,7 +33,7 @@
 
 #include <dbus/dbus-glib-bindings.h>
 
-#include <libtracker-common/tracker-storage.h>
+#include <libtracker-miner/tracker-storage.h>
 
 #include "tracker-albumart.h"
 #include "tracker-dbus.h"
@@ -46,7 +46,7 @@
 #define ALBUMARTER_INTERFACE  "com.nokia.albumart.Requester"
 
 typedef struct {
-	TrackerStorage *hal;
+	TrackerStorage *storage;
 	gchar *art_path;
 	gchar *local_uri;
 } GetFileInfo;
@@ -548,7 +548,7 @@ albumart_set (const unsigned char *buffer,
 }
 
 static void
-albumart_request_download (TrackerStorage *hal,
+albumart_request_download (TrackerStorage *storage,
                            const gchar    *album,
                            const gchar    *artist,
                            const gchar    *local_uri,
@@ -563,9 +563,9 @@ albumart_request_download (TrackerStorage *hal,
 	info = g_slice_new (GetFileInfo);
 
 #ifdef HAVE_HAL
-	info->hal = hal ? g_object_ref (hal) : NULL;
+	info->storage = storage ? g_object_ref (storage) : NULL;
 #else
-	info->hal = NULL;
+	info->storage = NULL;
 #endif
 
 	info->local_uri = g_strdup (local_uri);
@@ -600,7 +600,7 @@ albumart_request_download (TrackerStorage *hal,
 }
 
 static void
-albumart_copy_to_local (TrackerStorage *hal,
+albumart_copy_to_local (TrackerStorage *storage,
                         const gchar    *filename,
                         const gchar    *local_uri)
 {
@@ -610,7 +610,7 @@ albumart_copy_to_local (TrackerStorage *hal,
 
 	/* Determining if we are on a removable device */
 #ifdef HAVE_HAL
-	if (!hal) {
+	if (!storage) {
 		/* This is usually because we are running on the
 		 * command line, so we don't error here with
 		 * g_return_if_fail().
@@ -618,7 +618,7 @@ albumart_copy_to_local (TrackerStorage *hal,
 		return;
 	}
 
-	removable_roots = tracker_storage_get_removable_device_roots (hal);
+	removable_roots = tracker_storage_get_removable_device_roots (storage);
 #else
 	removable_roots = g_slist_append (removable_roots, "/media");
 	removable_roots = g_slist_append (removable_roots, "/mnt");
@@ -697,10 +697,10 @@ albumart_queue_cb (DBusGProxy     *proxy,
 		g_clear_error (&error);
 	}
 
-	if (info->hal && info->art_path &&
+	if (info->storage && info->art_path &&
 	    g_file_test (info->art_path, G_FILE_TEST_EXISTS)) {
 
-		albumart_copy_to_local (info->hal,
+		albumart_copy_to_local (info->storage,
 		                        info->art_path,
 		                        info->local_uri);
 	}
@@ -708,8 +708,8 @@ albumart_queue_cb (DBusGProxy     *proxy,
 	g_free (info->art_path);
 	g_free (info->local_uri);
 
-	if (info->hal) {
-		g_object_unref (info->hal);
+	if (info->storage) {
+		g_object_unref (info->storage);
 	}
 
 	g_slice_free (GetFileInfo, info);
diff --git a/src/tracker-miner-fs/tracker-miner-files.c b/src/tracker-miner-fs/tracker-miner-files.c
index d886458..34d8595 100644
--- a/src/tracker-miner-fs/tracker-miner-files.c
+++ b/src/tracker-miner-fs/tracker-miner-files.c
@@ -31,11 +31,11 @@
 #include <libtracker-common/tracker-date-time.h>
 #include <libtracker-common/tracker-ontologies.h>
 #include <libtracker-common/tracker-power.h>
-#include <libtracker-common/tracker-storage.h>
 #include <libtracker-common/tracker-type-utils.h>
 #include <libtracker-common/tracker-utils.h>
 
 #include <libtracker-miner/tracker-miner.h>
+#include <libtracker-miner/tracker-storage.h>
 
 #include "tracker-miner-files.h"
 #include "tracker-config.h"



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