tracker r1586 - in branches/indexer-split: . src/tracker-indexer src/tracker-indexer/modules
- From: carlosg svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1586 - in branches/indexer-split: . src/tracker-indexer src/tracker-indexer/modules
- Date: Thu, 5 Jun 2008 10:42:31 +0000 (UTC)
Author: carlosg
Date: Thu Jun 5 10:42:31 2008
New Revision: 1586
URL: http://svn.gnome.org/viewvc/tracker?rev=1586&view=rev
Log:
2008-06-05 Carlos Garnacho <carlos imendio com>
* src/tracker-indexer/modules/files.c (check_exclude_file): Exclude
also *.bak files.
(tracker_module_get_file_metadata): Insert missing things in the
metadata table, they're strings at the moment, although there should
be some way to deal with them as integer/times/boolean, etc...
* src/tracker-indexer/tracker-indexer-db.c
(tracker_db_create_service): Insert some missing data in the Services
table.
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/src/tracker-indexer/modules/files.c
branches/indexer-split/src/tracker-indexer/tracker-indexer-db.c
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 Thu Jun 5 10:42:31 2008
@@ -26,6 +26,7 @@
#include <libtracker-common/tracker-config.h>
#include <libtracker-common/tracker-file-utils.h>
+#include <libtracker-common/tracker-type-utils.h>
#include <libtracker-common/tracker-os-dependant.h>
#include <libtracker-common/tracker-ontology.h>
@@ -186,7 +187,7 @@
".csproj", ".m4", ".rej", ".gmo", ".orig",
".pc", ".omf", ".aux", ".tmp", ".po",
".vmdk",".vmx",".vmxf",".vmsd",".nvram",
- ".part"
+ ".part", ".bak"
};
const gchar const *ignore_prefix[] = {
@@ -280,15 +281,15 @@
g_free (link_path);
}
- tracker_metadata_get_embedded (file, mimetype, metadata);
+ /* FIXME: These should be dealt directly as integer/times/whatever, not strings */
+ g_hash_table_insert (metadata, METADATA_FILE_SIZE,
+ tracker_uint_to_string (st.st_size));
+ g_hash_table_insert (metadata, METADATA_FILE_MODIFIED,
+ tracker_uint_to_string (st.st_mtime));
+ g_hash_table_insert (metadata, METADATA_FILE_ACCESSED,
+ tracker_uint_to_string (st.st_atime));
- /* FIXME, Missing:
- *
- * File:Size
- * File:Modified
- * File:Accessed
- * Call external metadata extractor
- */
+ tracker_metadata_get_embedded (file, mimetype, metadata);
return metadata;
}
@@ -338,7 +339,6 @@
{
gchar *mimetype, *service_type;
gchar *text = NULL;
- GMappedFile *mapped_file;
mimetype = tracker_file_get_mime_type (file);
service_type = tracker_ontology_get_service_type_for_mime (mimetype);
Modified: branches/indexer-split/src/tracker-indexer/tracker-indexer-db.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-indexer-db.c (original)
+++ branches/indexer-split/src/tracker-indexer/tracker-indexer-db.c Thu Jun 5 10:42:31 2008
@@ -133,6 +133,7 @@
{
gchar *id_str, *service_type_id_str;
gchar *dirname, *basename;
+ gboolean is_dir, is_symlink;
if (!service) {
return FALSE;
@@ -144,16 +145,19 @@
dirname = g_path_get_dirname (path);
basename = g_path_get_basename (path);
+ is_dir = g_file_test (path, G_FILE_TEST_IS_DIR);
+ is_symlink = g_file_test (path, G_FILE_TEST_IS_SYMLINK);
+
/* FIXME: do not hardcode arguments */
tracker_db_interface_execute_procedure (iface, NULL, "CreateService",
id_str,
dirname,
basename,
service_type_id_str,
- g_hash_table_lookup (metadata, "File:Mime"),
+ is_dir ? "Folder" : g_hash_table_lookup (metadata, "File:Mime"),
g_hash_table_lookup (metadata, "File:Size"),
- "0", /* is dir */
- "0", /* is link */
+ is_dir ? "1" : "0",
+ is_symlink ? "1" : "0",
"0", /* offset */
g_hash_table_lookup (metadata, "File:Modified"),
"0", /* aux ID */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]