tracker r2008 - in branches/indexer-split: . src/tracker-indexer src/tracker-indexer/modules



Author: carlosg
Date: Tue Aug  5 15:44:59 2008
New Revision: 2008
URL: http://svn.gnome.org/viewvc/tracker?rev=2008&view=rev

Log:
2008-08-05  Carlos Garnacho  <carlos imendio com>

        * src/tracker-indexer/tracker-module.h
        (tracker_module_file_get_service_type):
        * src/tracker-indexer/tracker-indexer-module.[ch]
        (tracker_indexer_module_file_get_service_type): Modify to receive a
        TrackerFile.
        * src/tracker-indexer/tracker-indexer.c:
        * src/tracker-indexer/modules/dummy.c:
        * src/tracker-indexer/modules/files.c: Adapt to this change.
        * src/tracker-indexer/modules/evolution.c: Implement this method to
        get the correct service type for attachments.


Modified:
   branches/indexer-split/ChangeLog
   branches/indexer-split/src/tracker-indexer/modules/dummy.c
   branches/indexer-split/src/tracker-indexer/modules/evolution.c
   branches/indexer-split/src/tracker-indexer/modules/files.c
   branches/indexer-split/src/tracker-indexer/tracker-indexer-module.c
   branches/indexer-split/src/tracker-indexer/tracker-indexer-module.h
   branches/indexer-split/src/tracker-indexer/tracker-indexer.c
   branches/indexer-split/src/tracker-indexer/tracker-module.h

Modified: branches/indexer-split/src/tracker-indexer/modules/dummy.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/modules/dummy.c	(original)
+++ branches/indexer-split/src/tracker-indexer/modules/dummy.c	Tue Aug  5 15:44:59 2008
@@ -61,7 +61,7 @@
 }
 
 gchar *
-tracker_module_file_get_service_type (const gchar *path)
+tracker_module_file_get_service_type (TrackerFile *file)
 {
         /* Implementing this function is optional.
          *

Modified: branches/indexer-split/src/tracker-indexer/modules/evolution.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/modules/evolution.c	(original)
+++ branches/indexer-split/src/tracker-indexer/modules/evolution.c	Tue Aug  5 15:44:59 2008
@@ -1078,6 +1078,29 @@
         }
 }
 
+gchar *
+tracker_module_file_get_service_type (TrackerFile *file)
+{
+        EvolutionFileData *data;
+
+        data = file->data;
+
+        if (!data) {
+                /* It isn't any of the files the module handles */
+                return NULL;
+        }
+
+        if (data->type == MAIL_STORAGE_LOCAL) {
+                EvolutionLocalData *data = file->data;
+
+                if (data->current_mime_part) {
+                        return g_strdup ("EvolutionAttachments");
+                }
+        }
+
+        return g_strdup ("EvolutionEmails");
+}
+
 TrackerMetadata *
 tracker_module_file_get_metadata (TrackerFile *file)
 {

Modified: branches/indexer-split/src/tracker-indexer/modules/files.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/modules/files.c	(original)
+++ branches/indexer-split/src/tracker-indexer/modules/files.c	Tue Aug  5 15:44:59 2008
@@ -49,15 +49,15 @@
 }
 
 gchar *
-tracker_module_file_get_service_type (const gchar *uri) 
+tracker_module_file_get_service_type (TrackerFile *file)
 {
         gchar *mimetype;
         gchar *service_type;
 
-        mimetype = tracker_file_get_mime_type (uri);
+        mimetype = tracker_file_get_mime_type (file->path);
         service_type = tracker_ontology_get_service_type_for_mime (mimetype);
         g_free (mimetype);
-        
+
         return service_type;
 }
 

Modified: branches/indexer-split/src/tracker-indexer/tracker-indexer-module.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-indexer-module.c	(original)
+++ branches/indexer-split/src/tracker-indexer/tracker-indexer-module.c	Tue Aug  5 15:44:59 2008
@@ -152,12 +152,13 @@
 }
 
 gchar *
-tracker_indexer_module_file_get_service_type  (GModule      *module,
-					       const gchar   *path)
+tracker_indexer_module_file_get_service_type (GModule     *module,
+					      TrackerFile *file)
 {
 	TrackerModuleFileGetServiceTypeFunc func;
+
 	if (g_module_symbol (module, "tracker_module_file_get_service_type", (gpointer *) &func)) {
-		return (func) (path);
+		return (func) (file);
 	} else {
 		return g_strdup (tracker_indexer_module_get_name (module));
 	}

Modified: branches/indexer-split/src/tracker-indexer/tracker-indexer-module.h
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-indexer-module.h	(original)
+++ branches/indexer-split/src/tracker-indexer/tracker-indexer-module.h	Tue Aug  5 15:44:59 2008
@@ -46,7 +46,7 @@
 								       gchar       **dirname,
 								       gchar       **basename);
 gchar *                 tracker_indexer_module_file_get_service_type  (GModule      *module,
-								       const gchar   *path);
+								       TrackerFile  *file);
 TrackerMetadata *       tracker_indexer_module_file_get_metadata      (GModule      *module,
 								       TrackerFile  *file);
 gchar *                 tracker_indexer_module_file_get_text          (GModule      *module,

Modified: branches/indexer-split/src/tracker-indexer/tracker-indexer.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-indexer.c	(original)
+++ branches/indexer-split/src/tracker-indexer/tracker-indexer.c	Tue Aug  5 15:44:59 2008
@@ -923,7 +923,7 @@
 	gchar *text;
 	guint32 id;
 
-	service_type = tracker_indexer_module_file_get_service_type (info->module, info->file->path);
+	service_type = tracker_indexer_module_file_get_service_type (info->module, info->file);
 
 	service_def = tracker_ontology_get_service_type_by_name (service_type);
 	g_free (service_type);

Modified: branches/indexer-split/src/tracker-indexer/tracker-module.h
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-module.h	(original)
+++ branches/indexer-split/src/tracker-indexer/tracker-module.h	Tue Aug  5 15:44:59 2008
@@ -42,7 +42,7 @@
 typedef gpointer          (* TrackerModuleFileGetDataFunc)  (const gchar *path);
 typedef void              (* TrackerModuleFileFreeDataFunc) (gpointer     data);
 
-typedef gchar *           (* TrackerModuleFileGetServiceTypeFunc) (const gchar *path);
+typedef gchar *           (* TrackerModuleFileGetServiceTypeFunc) (TrackerFile  *file);
 typedef void              (* TrackerModuleFileGetUriFunc)         (TrackerFile  *file,
                                                                    gchar       **dirname,
                                                                    gchar       **basename);
@@ -60,7 +60,7 @@
 gpointer               tracker_module_file_get_data  (const gchar *path);
 void                   tracker_module_file_free_data (gpointer     file_data);
 
-gchar *                tracker_module_file_get_service_type  (const gchar *path);
+gchar *                tracker_module_file_get_service_type  (TrackerFile *file);
 void                   tracker_module_file_get_uri   (TrackerFile  *file,
                                                       gchar       **dirname,
                                                       gchar       **basename);



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