Commit d91f1a7a authored by Carlos Garnacho's avatar Carlos Garnacho Committed by Carlos Garnacho

Set File:Modified to the current time() if the module didn't provide any.

2009-01-29  Carlos Garnacho  <carlos@imendio.com>

        * src/tracker-indexer/tracker-module-file.c
        (tracker_module_file_get_metadata): Set File:Modified to the current
        time() if the module didn't provide any.

svn path=/trunk/; revision=2860
parent 989377ea
2009-01-29 Carlos Garnacho <carlos@imendio.com>
* src/tracker-indexer/tracker-module-file.c
(tracker_module_file_get_metadata): Set File:Modified to the current
time() if the module didn't provide any.
2009-01-29 Carlos Garnacho <carlos@imendio.com>
* src/tracker-indexer/tracker-indexer.c (should_index_file): Always
......
......@@ -23,6 +23,7 @@
#define METADATA_FILE_PATH "File:Path"
#define METADATA_FILE_NAME "File:Name"
#define METADATA_FILE_MODIFIED "File:Modified"
#define TRACKER_MODULE_FILE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRACKER_TYPE_MODULE_FILE, TrackerModuleFilePrivate))
......@@ -270,8 +271,11 @@ tracker_module_file_get_metadata (TrackerModuleFile *file)
metadata = TRACKER_MODULE_FILE_GET_CLASS (file)->get_metadata (file);
}
if (metadata &&
!tracker_module_metadata_lookup (metadata, METADATA_FILE_PATH, NULL) &&
if (!metadata) {
return NULL;
}
if (!tracker_module_metadata_lookup (metadata, METADATA_FILE_PATH, NULL) &&
!tracker_module_metadata_lookup (metadata, METADATA_FILE_NAME, NULL)) {
gchar *uri, *dirname, *basename;
......@@ -286,6 +290,10 @@ tracker_module_file_get_metadata (TrackerModuleFile *file)
g_free (uri);
}
if (!tracker_module_metadata_lookup (metadata, METADATA_FILE_MODIFIED, NULL)) {
tracker_module_metadata_add_date (metadata, METADATA_FILE_MODIFIED, time (NULL));
}
return metadata;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment