tracker r2802 - in trunk: . data/services src/libtracker-data src/libtracker-db src/tracker-indexer
- From: carlosg svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2802 - in trunk: . data/services src/libtracker-data src/libtracker-db src/tracker-indexer
- Date: Fri, 16 Jan 2009 12:18:43 +0000 (UTC)
Author: carlosg
Date: Fri Jan 16 12:18:43 2009
New Revision: 2802
URL: http://svn.gnome.org/viewvc/tracker?rev=2802&view=rev
Log:
2009-01-06 Carlos Garnacho <carlos imendio com>
* src/libtracker-db/tracker-db-manager.c (load_metadata_file): Warn on
invalid/unparseable data types.
* src/tracker-indexer/tracker-module-metadata.c
(tracker_module_metadata_add_date): Convert time_t to string directly
instead of dates.
* src/libtracker-data/tracker-data-update.c
(tracker_data_update_create_service): So we don't have to convert them
back to unix times here.
* data/services/email.metadata:
* data/services/image.metadata: Fix invalid data types so Tracker now
recognizes them.
Modified:
trunk/ChangeLog
trunk/data/services/email.metadata
trunk/data/services/image.metadata
trunk/src/libtracker-data/tracker-data-update.c
trunk/src/libtracker-db/tracker-db-manager.c
trunk/src/tracker-indexer/tracker-module-metadata.c
Modified: trunk/data/services/email.metadata
==============================================================================
--- trunk/data/services/email.metadata (original)
+++ trunk/data/services/email.metadata Fri Jan 16 12:18:43 2009
@@ -2,38 +2,38 @@
Abstract=true
DisplayName=Recipient
Description=The recepient of an email
-DataType=Indexable
+DataType=index
[Email:Body]
DisplayName=Body
Description=The body contents of the email
-DataType=CLOB
+DataType=blob
Weight=1
[Email:Date]
DisplayName=Date
Description=Date email was sent
-DataType=DateTime
+DataType=date
Parent=DC:Date
[Email:Sender]
DisplayName=Sender
Description=The sender of the email
-DataType=Indexable
+DataType=index
Parent=DC:Creator
Weight=10
[Email:Subject]
DisplayName=Subject
Description=The subject of the email
-DataType=Indexable
+DataType=index
Parent=DC:Subject
Weight=20
[Email:SentTo]
DisplayName=Sent to
Description=The group of people the email was sent to
-DataType=Indexable
+DataType=index
MultipleValues=true
Parent=Email:Recipient
Weight=10
@@ -41,7 +41,7 @@
[Email:CC]
DisplayName=CC
Description=The CC recipients of the email
-DataType=Indexable
+DataType=index
MultipleValues=true
Parent=Email:Recipient
Weight=5
@@ -49,13 +49,13 @@
[Email:Attachments]
DisplayName=Attachments
Description=The names of the attachments
-DataType=Indexable
+DataType=index
Weight=5
[Email:AttachmentsDelimited]
DisplayName=AttachmentsDelimited
Description=The names of the attachments with extra delimiting
-DataType=Indexable
+DataType=index
Weight=5
Modified: trunk/data/services/image.metadata
==============================================================================
--- trunk/data/services/image.metadata (original)
+++ trunk/data/services/image.metadata Fri Jan 16 12:18:43 2009
@@ -35,7 +35,7 @@
[Image:Date]
DisplayName=Created
Description=Date image was created or shot
-DataType=DateTime
+DataType=date
Parent=DC:Date
[Image:Creator]
Modified: trunk/src/libtracker-data/tracker-data-update.c
==============================================================================
--- trunk/src/libtracker-data/tracker-data-update.c (original)
+++ trunk/src/libtracker-data/tracker-data-update.c Fri Jan 16 12:18:43 2009
@@ -164,7 +164,7 @@
TrackerDBInterface *iface;
TrackerDBResultSet *result_set;
guint32 volume_id = 0;
- gchar *id_str, *service_type_id_str, *path, *volume_id_str, *time_str;
+ gchar *id_str, *service_type_id_str, *path, *volume_id_str;
gboolean is_dir, is_symlink;
if (!service) {
@@ -194,7 +194,6 @@
is_dir = g_file_test (path, G_FILE_TEST_IS_DIR);
is_symlink = g_file_test (path, G_FILE_TEST_IS_SYMLINK);
- time_str = tracker_date_to_time_string (g_hash_table_lookup (metadata, "File:Modified"));
tracker_db_interface_execute_procedure (iface, NULL, "CreateService",
id_str,
@@ -206,7 +205,7 @@
is_dir ? "1" : "0",
is_symlink ? "1" : "0",
"0", /* Offset */
- time_str,
+ g_hash_table_lookup (metadata, "File:Modified"),
volume_id_str, /* Aux ID */
NULL);
@@ -214,7 +213,6 @@
g_free (service_type_id_str);
g_free (volume_id_str);
g_free (path);
- g_free (time_str);
return TRUE;
}
@@ -363,7 +361,6 @@
TrackerDBInterface *iface;
gint metadata_key;
gchar *id_str;
- gchar *time_string;
id_str = tracker_guint32_to_string (service_id);
iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
@@ -392,6 +389,7 @@
break;
case TRACKER_FIELD_TYPE_INTEGER:
+ case TRACKER_FIELD_TYPE_DATE:
tracker_db_interface_execute_procedure (iface, NULL,
"SetMetadataNumeric",
id_str,
@@ -400,21 +398,6 @@
NULL);
break;
- case TRACKER_FIELD_TYPE_DATE:
-
- time_string = tracker_date_to_time_string (value);
-
- if (time_string) {
- tracker_db_interface_execute_procedure (iface, NULL,
- "SetMetadataNumeric",
- id_str,
- tracker_field_get_id (field),
- time_string,
- NULL);
- g_free (time_string);
- }
- break;
-
case TRACKER_FIELD_TYPE_FULLTEXT:
tracker_data_update_set_content (service, service_id, value);
break;
@@ -432,11 +415,7 @@
if (metadata_key > 0) {
gchar *val;
- if (tracker_field_get_data_type (field) == TRACKER_FIELD_TYPE_DATE) {
- val = tracker_date_to_time_string (value);
- } else {
- val = tracker_escape_string (value);
- }
+ val = tracker_escape_string (value);
tracker_db_interface_execute_query (iface, NULL,
"update Services set KeyMetadata%d = '%s' where id = %d",
Modified: trunk/src/libtracker-db/tracker-db-manager.c
==============================================================================
--- trunk/src/libtracker-db/tracker-db-manager.c (original)
+++ trunk/src/libtracker-db/tracker-db-manager.c Fri Jan 16 12:18:43 2009
@@ -340,6 +340,8 @@
tracker_db_interface_execute_query (iface, NULL,
"update MetaDataTypes set DataTypeID = %d where ID = %d",
enum_value->value, id);
+ } else {
+ g_critical ("Field '%s' doesn't have a valid data type '%s'", groups[i], new_value);
}
} else {
gchar *esc_value;
Modified: trunk/src/tracker-indexer/tracker-module-metadata.c
==============================================================================
--- trunk/src/tracker-indexer/tracker-module-metadata.c (original)
+++ trunk/src/tracker-indexer/tracker-module-metadata.c Fri Jan 16 12:18:43 2009
@@ -331,7 +331,11 @@
{
gchar *str;
- str = tracker_date_to_string (value);
+ if (sizeof (time_t) == 8) {
+ str = g_strdup_printf ("%" G_GINT64_FORMAT, value);
+ } else {
+ str = g_strdup_printf ("%d", value);
+ }
if (!tracker_module_metadata_add_take_string (metadata, field_name, str)) {
g_free (str);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]