tracker r2455 - in branches/libtracker-data: . src/libtracker-data src/tracker-indexer src/tracker-indexer/modules src/trackerd
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2455 - in branches/libtracker-data: . src/libtracker-data src/tracker-indexer src/tracker-indexer/modules src/trackerd
- Date: Wed, 5 Nov 2008 13:01:30 +0000 (UTC)
Author: juergbi
Date: Wed Nov 5 13:01:30 2008
New Revision: 2455
URL: http://svn.gnome.org/viewvc/tracker?rev=2455&view=rev
Log:
2008-11-05 JÃrg Billeter <j bitron ch>
* src/libtracker-data/tracker-data-manager.c:
* src/libtracker-data/tracker-data-manager.h:
* src/libtracker-data/tracker-data-metadata.c:
* src/libtracker-data/tracker-data-metadata.h:
* src/libtracker-data/tracker-data-update.c:
* src/libtracker-data/tracker-data-update.h:
* src/tracker-indexer/modules/applications.c:
* src/tracker-indexer/modules/evolution.c:
* src/tracker-indexer/modules/files.c:
* src/tracker-indexer/tracker-indexer-module.c:
* src/tracker-indexer/tracker-indexer-module.h:
* src/tracker-indexer/tracker-indexer.c:
* src/tracker-indexer/tracker-metadata-utils.c:
* src/tracker-indexer/tracker-metadata-utils.h:
* src/tracker-indexer/tracker-module.h:
* src/trackerd/tracker-daemon.c:
* src/trackerd/tracker-files.c:
* src/trackerd/tracker-main.c:
* src/trackerd/tracker-search.c:
Use tracker_data_manager, tracker_data_metadata, and
tracker_data_update as function namespaces
Modified:
branches/libtracker-data/ChangeLog
branches/libtracker-data/src/libtracker-data/tracker-data-manager.c
branches/libtracker-data/src/libtracker-data/tracker-data-manager.h
branches/libtracker-data/src/libtracker-data/tracker-data-metadata.c
branches/libtracker-data/src/libtracker-data/tracker-data-metadata.h
branches/libtracker-data/src/libtracker-data/tracker-data-update.c
branches/libtracker-data/src/libtracker-data/tracker-data-update.h
branches/libtracker-data/src/tracker-indexer/modules/applications.c
branches/libtracker-data/src/tracker-indexer/modules/evolution.c
branches/libtracker-data/src/tracker-indexer/modules/files.c
branches/libtracker-data/src/tracker-indexer/tracker-indexer-module.c
branches/libtracker-data/src/tracker-indexer/tracker-indexer-module.h
branches/libtracker-data/src/tracker-indexer/tracker-indexer.c
branches/libtracker-data/src/tracker-indexer/tracker-metadata-utils.c
branches/libtracker-data/src/tracker-indexer/tracker-metadata-utils.h
branches/libtracker-data/src/tracker-indexer/tracker-module.h
branches/libtracker-data/src/trackerd/tracker-daemon.c
branches/libtracker-data/src/trackerd/tracker-files.c
branches/libtracker-data/src/trackerd/tracker-main.c
branches/libtracker-data/src/trackerd/tracker-search.c
Modified: branches/libtracker-data/src/libtracker-data/tracker-data-manager.c
==============================================================================
--- branches/libtracker-data/src/libtracker-data/tracker-data-manager.c (original)
+++ branches/libtracker-data/src/libtracker-data/tracker-data-manager.c Wed Nov 5 13:01:30 2008
@@ -116,7 +116,7 @@
}
void
-tracker_db_init (TrackerConfig *config,
+tracker_data_manager_init (TrackerConfig *config,
TrackerLanguage *language,
TrackerDBIndex *file_index,
TrackerDBIndex *email_index)
@@ -146,7 +146,7 @@
}
void
-tracker_db_shutdown (void)
+tracker_data_manager_shutdown (void)
{
TrackerDBPrivate *private;
@@ -160,8 +160,30 @@
g_static_private_free (&private_key);
}
+TrackerConfig *
+tracker_data_manager_get_config (void)
+{
+ TrackerDBPrivate *private;
+
+ private = g_static_private_get (&private_key);
+ g_return_val_if_fail (private != NULL, NULL);
+
+ return private->config;
+}
+
+TrackerLanguage *
+tracker_data_manager_get_language (void)
+{
+ TrackerDBPrivate *private;
+
+ private = g_static_private_get (&private_key);
+ g_return_val_if_fail (private != NULL, NULL);
+
+ return private->language;
+}
+
gboolean
-tracker_db_exec_no_reply (TrackerDBInterface *iface,
+tracker_data_manager_exec_no_reply (TrackerDBInterface *iface,
const gchar *query,
...)
{
@@ -187,7 +209,7 @@
}
TrackerDBResultSet *
-tracker_db_exec (TrackerDBInterface *iface,
+tracker_data_manager_exec (TrackerDBInterface *iface,
const gchar *query,
...)
{
@@ -212,7 +234,7 @@
}
TrackerDBResultSet *
-tracker_db_exec_proc (TrackerDBInterface *iface,
+tracker_data_manager_exec_proc (TrackerDBInterface *iface,
const gchar *procedure,
...)
{
@@ -293,7 +315,7 @@
if (save_results) {
tracker_db_interface_start_transaction (iface);
- tracker_db_exec_proc (iface,
+ tracker_data_manager_exec_proc (iface,
"DeleteSearchResults1",
NULL);
}
@@ -318,7 +340,7 @@
gchar *str_score;
str_score = tracker_gint_to_string (rank.score);
- tracker_db_exec_proc (iface,
+ tracker_data_manager_exec_proc (iface,
"InsertSearchResult1",
str_id,
str_score,
@@ -341,7 +363,7 @@
procedure = "GetFileByID";
}
- result_set = tracker_db_exec_proc (iface,
+ result_set = tracker_data_manager_exec_proc (iface,
procedure,
str_id,
NULL);
@@ -461,7 +483,7 @@
rank = g_array_index (hits, TrackerDBIndexItemRank, i);
str_id = tracker_guint_to_string (rank.service_id);
- result_set2 = tracker_db_exec_proc (iface,
+ result_set2 = tracker_data_manager_exec_proc (iface,
"GetFileByID",
str_id,
NULL);
@@ -559,7 +581,7 @@
rank = g_array_index (hits, TrackerDBIndexItemRank, i);
str_id = tracker_guint_to_string (rank.service_id);
- result_set2 = tracker_db_exec_proc (iface,
+ result_set2 = tracker_data_manager_exec_proc (iface,
"GetFileByID",
str_id,
NULL);
@@ -659,7 +681,7 @@
rank = g_array_index (hits, TrackerDBIndexItemRank, i);
str_id = tracker_guint_to_string (rank.service_id);
- result_set2 = tracker_db_exec_proc (iface,
+ result_set2 = tracker_data_manager_exec_proc (iface,
"GetFileByID",
str_id,
NULL);
@@ -770,7 +792,7 @@
return NULL;
}
- return tracker_db_exec_proc (iface,
+ return tracker_data_manager_exec_proc (iface,
proc,
id,
tracker_field_get_id (def),
@@ -820,7 +842,7 @@
return result;
}
- result_set = tracker_db_exec_proc (iface, "GetAllMetadata", service_id, service_id, service_id, NULL);
+ result_set = tracker_data_manager_exec_proc (iface, "GetAllMetadata", service_id, service_id, service_id, NULL);
if (result_set) {
db_result_set_to_ptr_array (result_set, &result);
@@ -955,7 +977,7 @@
g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
g_return_val_if_fail (name != NULL, NULL);
- result_set = tracker_db_exec_proc (iface,
+ result_set = tracker_data_manager_exec_proc (iface,
"GetMetadataAliasesForName",
name,
name,
@@ -996,7 +1018,7 @@
g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
g_return_val_if_fail (name != NULL, NULL);
- result_set = tracker_db_exec_proc (iface,
+ result_set = tracker_data_manager_exec_proc (iface,
"GetXesamMetaDataLookups",
name,
NULL);
@@ -1011,7 +1033,7 @@
g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
- result_set = tracker_db_exec_proc (iface,
+ result_set = tracker_data_manager_exec_proc (iface,
"GetXesamMetaDataTextLookups",
NULL);
@@ -1027,7 +1049,7 @@
g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
g_return_val_if_fail (name != NULL, NULL);
- result_set = tracker_db_exec_proc (iface,
+ result_set = tracker_data_manager_exec_proc (iface,
"GetXesamServiceLookups",
name,
NULL);
@@ -1072,7 +1094,7 @@
g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
g_return_val_if_fail (search_id != NULL, NULL);
- return tracker_db_exec_proc (iface,
+ return tracker_data_manager_exec_proc (iface,
"GetLiveSearchHitCount",
search_id,
NULL);
@@ -1101,7 +1123,7 @@
join_query,
where_query);
- tracker_db_exec_no_reply (iface,
+ tracker_data_manager_exec_no_reply (iface,
"INSERT INTO cache.LiveSearches SELECT S.ID, '%s' %s %s %s",
search_id,
from_query,
@@ -1142,7 +1164,7 @@
g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
g_return_val_if_fail (search_id != NULL, NULL);
- return tracker_db_exec_proc (iface,
+ return tracker_data_manager_exec_proc (iface,
"GetLiveSearchAllIDs",
search_id,
NULL);
@@ -1196,7 +1218,7 @@
// We need to add 'file-meta' and 'email-meta' here
- result_set = tracker_db_exec (iface,
+ result_set = tracker_data_manager_exec (iface,
"SELECT E.ServiceID, E.EventType "
"%s%s cache.LiveSearches as X, Events as E " /* FROM A1 */
"%s" /* JOINS A2 */
@@ -1223,7 +1245,7 @@
where_query ? where_query : "WHERE", /* B3 */
where_query ? "AND " : ""); /* B3 */
- tracker_db_exec_no_reply (iface,
+ tracker_data_manager_exec_no_reply (iface,
"INSERT INTO cache.LiveSearches "
"SELECT E.ServiceID, '%s' " /* B0 */
"%s%s Events as E " /* FROM B1 */
@@ -1262,7 +1284,7 @@
g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
g_return_val_if_fail (search_id != NULL, NULL);
- result_set = tracker_db_exec_proc (iface,
+ result_set = tracker_data_manager_exec_proc (iface,
"GetLiveSearchDeletedIDs",
search_id,
NULL);
@@ -1298,7 +1320,7 @@
g_debug ("add metadata field");
- result_set = tracker_db_exec_proc (iface, "GetXesamMetaDataMappings",xesam_name, NULL);
+ result_set = tracker_data_manager_exec_proc (iface, "GetXesamMetaDataMappings",xesam_name, NULL);
if (!result_set) {
return NULL;
@@ -1413,7 +1435,7 @@
"WHERE X.SearchID = '%s'",
sql_select->str, sql_join->str, search_id);
- result = tracker_db_exec (iface,
+ result = tracker_data_manager_exec (iface,
"SELECT %s FROM cache.LiveSearches as X \n"
"%s"
"WHERE X.SearchID = '%s'",
@@ -1430,7 +1452,7 @@
{
g_return_if_fail (TRACKER_IS_DB_INTERFACE (iface));
- tracker_db_exec (iface, "DELETE FROM Events WHERE BeingHandled = 1");
+ tracker_data_manager_exec (iface, "DELETE FROM Events WHERE BeingHandled = 1");
}
/*
@@ -1447,7 +1469,7 @@
g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
g_return_val_if_fail (id != NULL, NULL);
- result_set = tracker_db_exec_proc (iface,
+ result_set = tracker_data_manager_exec_proc (iface,
"GetFileByID",
id,
NULL);
@@ -1484,7 +1506,7 @@
tracker_file_get_path_and_name (uri, &path, &name);
- result_set = tracker_db_exec_proc (iface,
+ result_set = tracker_data_manager_exec_proc (iface,
"GetServiceID",
path,
name,
@@ -1528,7 +1550,7 @@
g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
g_return_val_if_fail (uri != NULL, NULL);
- result_set = tracker_db_exec_proc (iface,
+ result_set = tracker_data_manager_exec_proc (iface,
"SelectFileChild",
uri,
NULL);
@@ -1575,7 +1597,7 @@
str_limit = tracker_gint_to_string (limit);
str_offset = tracker_gint_to_string (offset);
- result_set = tracker_db_exec_proc (iface,
+ result_set = tracker_data_manager_exec_proc (iface,
"GetByServiceType",
service,
service,
@@ -1642,7 +1664,7 @@
g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
g_return_val_if_fail (service != NULL, NULL);
- return tracker_db_exec_proc (iface,
+ return tracker_data_manager_exec_proc (iface,
"GetKeywordList",
service,
service,
@@ -1731,7 +1753,7 @@
}
gint
-tracker_db_get_option_int (const gchar *option)
+tracker_data_manager_get_db_option_int (const gchar *option)
{
TrackerDBInterface *iface;
TrackerDBResultSet *result_set;
@@ -1749,7 +1771,7 @@
iface = tracker_db_manager_get_db_interface_by_service (TRACKER_DB_FOR_FILE_SERVICE);
- result_set = tracker_db_exec_proc (iface, "GetOption", option, NULL);
+ result_set = tracker_data_manager_exec_proc (iface, "GetOption", option, NULL);
if (result_set) {
tracker_db_result_set_get (result_set, 0, &str, -1);
@@ -1766,7 +1788,7 @@
}
void
-tracker_db_set_option_int (const gchar *option,
+tracker_data_manager_set_db_option_int (const gchar *option,
gint value)
{
TrackerDBInterface *iface;
@@ -1785,7 +1807,7 @@
iface = tracker_db_manager_get_db_interface_by_service (TRACKER_DB_FOR_FILE_SERVICE);
str = tracker_gint_to_string (value);
- result_set = tracker_db_exec_proc (iface, "SetOption", str, option, NULL);
+ result_set = tracker_data_manager_exec_proc (iface, "SetOption", str, option, NULL);
g_free (str);
if (result_set) {
Modified: branches/libtracker-data/src/libtracker-data/tracker-data-manager.h
==============================================================================
--- branches/libtracker-data/src/libtracker-data/tracker-data-manager.h (original)
+++ branches/libtracker-data/src/libtracker-data/tracker-data-manager.h Wed Nov 5 13:01:30 2008
@@ -38,27 +38,29 @@
G_BEGIN_DECLS
-void tracker_db_init (TrackerConfig *config,
+void tracker_data_manager_init (TrackerConfig *config,
TrackerLanguage *language,
TrackerDBIndex *file_index,
TrackerDBIndex *email_index);
-void tracker_db_shutdown (void);
+void tracker_data_manager_shutdown (void);
+TrackerConfig * tracker_data_manager_get_config (void);
+TrackerLanguage * tracker_data_manager_get_language (void);
GArray * tracker_db_create_array_of_services (const gchar *service,
gboolean basic_services);
/* Operations for TrackerDBInterface */
-TrackerDBResultSet *tracker_db_exec_proc (TrackerDBInterface *iface,
+TrackerDBResultSet *tracker_data_manager_exec_proc (TrackerDBInterface *iface,
const gchar *procedure,
...);
-gboolean tracker_db_exec_no_reply (TrackerDBInterface *iface,
+gboolean tracker_data_manager_exec_no_reply (TrackerDBInterface *iface,
const gchar *query,
...);
-TrackerDBResultSet *tracker_db_exec (TrackerDBInterface *iface,
+TrackerDBResultSet *tracker_data_manager_exec (TrackerDBInterface *iface,
const char *query,
...);
-gint tracker_db_get_option_int (const gchar *option);
-void tracker_db_set_option_int (const gchar *option,
+gint tracker_data_manager_get_db_option_int (const gchar *option);
+void tracker_data_manager_set_db_option_int (const gchar *option,
gint value);
/* Metadata API */
Modified: branches/libtracker-data/src/libtracker-data/tracker-data-metadata.c
==============================================================================
--- branches/libtracker-data/src/libtracker-data/tracker-data-metadata.c (original)
+++ branches/libtracker-data/src/libtracker-data/tracker-data-metadata.c Wed Nov 5 13:01:30 2008
@@ -23,23 +23,23 @@
#include <libtracker-common/tracker-ontology.h>
#include "tracker-data-metadata.h"
-struct TrackerMetadata {
+struct TrackerDataMetadata {
GHashTable *table;
};
/**
- * tracker_metadata_new:
+ * tracker_data_metadata_new:
*
- * Creates a new #TrackerMetadata with no data in it.
+ * Creates a new #TrackerDataMetadata with no data in it.
*
- * Returns: The newly created #TrackerMetadata
+ * Returns: The newly created #TrackerDataMetadata
**/
-TrackerMetadata *
-tracker_metadata_new (void)
+TrackerDataMetadata *
+tracker_data_metadata_new (void)
{
- TrackerMetadata *metadata;
+ TrackerDataMetadata *metadata;
- metadata = g_slice_new (TrackerMetadata);
+ metadata = g_slice_new (TrackerDataMetadata);
metadata->table = g_hash_table_new_full (g_direct_hash,
g_direct_equal,
(GDestroyNotify) g_object_unref,
@@ -70,34 +70,34 @@
}
/**
- * tracker_metadata_free:
- * @metadata: A #TrackerMetadata
+ * tracker_data_metadata_free:
+ * @metadata: A #TrackerDataMetadata
*
- * Frees the #TrackerMetadata and any contained data.
+ * Frees the #TrackerDataMetadata and any contained data.
**/
void
-tracker_metadata_free (TrackerMetadata *metadata)
+tracker_data_metadata_free (TrackerDataMetadata *metadata)
{
g_hash_table_foreach_remove (metadata->table,
remove_metadata_foreach,
NULL);
g_hash_table_destroy (metadata->table);
- g_slice_free (TrackerMetadata, metadata);
+ g_slice_free (TrackerDataMetadata, metadata);
}
/**
- * tracker_metadata_insert:
- * @metadata: A #TrackerMetadata
+ * tracker_data_metadata_insert:
+ * @metadata: A #TrackerDataMetadata
* @field_name: Field name for the metadata to insert.
* @value: Value for the metadata to insert.
*
* Inserts a new metadata element into @metadata.
**/
void
-tracker_metadata_insert (TrackerMetadata *metadata,
- const gchar *field_name,
- gchar *value)
+tracker_data_metadata_insert (TrackerDataMetadata *metadata,
+ const gchar *field_name,
+ gchar *value)
{
TrackerField *field;
@@ -117,8 +117,8 @@
}
/**
- * tracker_metadata_insert_multiple_values:
- * @metadata: A #TrackerMetadata
+ * tracker_data_metadata_insert_multiple_values:
+ * @metadata: A #TrackerDataMetadata
* @field_name: Field name for the metadata to insert
* @list: Value list for the metadata to insert
*
@@ -126,9 +126,9 @@
* The ontology has to specify that @field_name allows multiple values.
**/
void
-tracker_metadata_insert_multiple_values (TrackerMetadata *metadata,
- const gchar *field_name,
- GList *list)
+tracker_data_metadata_insert_multiple_values (TrackerDataMetadata *metadata,
+ const gchar *field_name,
+ GList *list)
{
TrackerField *field;
@@ -143,8 +143,8 @@
}
/**
- * tracker_metadata_lookup:
- * @metadata: A #TrackerMetadata
+ * tracker_data_metadata_lookup:
+ * @metadata: A #TrackerDataMetadata
* @field_name: Field name to look up
*
* Returns the value corresponding to the metadata specified by @field_name.
@@ -152,8 +152,8 @@
* Returns: The value. This string is owned by @metadata and must not be modified or freed.
**/
G_CONST_RETURN gchar *
-tracker_metadata_lookup (TrackerMetadata *metadata,
- const gchar *field_name)
+tracker_data_metadata_lookup (TrackerDataMetadata *metadata,
+ const gchar *field_name)
{
TrackerField *field;
@@ -166,8 +166,8 @@
}
/**
- * tracker_metadata_lookup_multiple_values:
- * @metadata: A #TrackerMetadata
+ * tracker_data_metadata_lookup_multiple_values:
+ * @metadata: A #TrackerDataMetadata
* @field_name: Field name to look up
*
* Returns the value list corresponding to the metadata specified by @field_name.
@@ -176,8 +176,8 @@
* are owned by @metadata and must not be modified or freed.
**/
G_CONST_RETURN GList *
-tracker_metadata_lookup_multiple_values (TrackerMetadata *metadata,
- const gchar *field_name)
+tracker_data_metadata_lookup_multiple_values (TrackerDataMetadata *metadata,
+ const gchar *field_name)
{
TrackerField *field;
@@ -190,17 +190,17 @@
}
/**
- * tracker_metadata_foreach:
- * @metadata: A #TrackerMetadata.
+ * tracker_data_metadata_foreach:
+ * @metadata: A #TrackerDataMetadata.
* @func: The function to call with each metadata.
* @user_data: user data to pass to the function.
*
* Calls a function for each element in @metadata.
**/
void
-tracker_metadata_foreach (TrackerMetadata *metadata,
- TrackerMetadataForeach func,
- gpointer user_data)
+tracker_data_metadata_foreach (TrackerDataMetadata *metadata,
+ TrackerDataMetadataForeach func,
+ gpointer user_data)
{
g_hash_table_foreach (metadata->table,
(GHFunc) func,
Modified: branches/libtracker-data/src/libtracker-data/tracker-data-metadata.h
==============================================================================
--- branches/libtracker-data/src/libtracker-data/tracker-data-metadata.h (original)
+++ branches/libtracker-data/src/libtracker-data/tracker-data-metadata.h Wed Nov 5 13:01:30 2008
@@ -25,30 +25,30 @@
#include <glib.h>
#include <libtracker-common/tracker-common.h>
-typedef struct TrackerMetadata TrackerMetadata;
+typedef struct TrackerDataMetadata TrackerDataMetadata;
-typedef void (* TrackerMetadataForeach) (TrackerField *field,
- gpointer value,
- gpointer user_data);
-
-TrackerMetadata * tracker_metadata_new (void);
-void tracker_metadata_free (TrackerMetadata *metadata);
-
-void tracker_metadata_insert (TrackerMetadata *metadata,
- const gchar *field_name,
- gchar *value);
-void tracker_metadata_insert_multiple_values (TrackerMetadata *metadata,
- const gchar *field_name,
- GList *list);
-
-G_CONST_RETURN gchar * tracker_metadata_lookup (TrackerMetadata *metadata,
- const gchar *field_name);
-G_CONST_RETURN GList * tracker_metadata_lookup_multiple_values (TrackerMetadata *metadata,
- const gchar *field_name);
-
-void tracker_metadata_foreach (TrackerMetadata *metadata,
- TrackerMetadataForeach func,
- gpointer user_data);
+typedef void (* TrackerDataMetadataForeach) (TrackerField *field,
+ gpointer value,
+ gpointer user_data);
+
+TrackerDataMetadata * tracker_data_metadata_new (void);
+void tracker_data_metadata_free (TrackerDataMetadata *metadata);
+
+void tracker_data_metadata_insert (TrackerDataMetadata *metadata,
+ const gchar *field_name,
+ gchar *value);
+void tracker_data_metadata_insert_multiple_values (TrackerDataMetadata *metadata,
+ const gchar *field_name,
+ GList *list);
+
+G_CONST_RETURN gchar * tracker_data_metadata_lookup (TrackerDataMetadata *metadata,
+ const gchar *field_name);
+G_CONST_RETURN GList * tracker_data_metadata_lookup_multiple_values (TrackerDataMetadata *metadata,
+ const gchar *field_name);
+
+void tracker_data_metadata_foreach (TrackerDataMetadata *metadata,
+ TrackerDataMetadataForeach func,
+ gpointer user_data);
G_END_DECLS
Modified: branches/libtracker-data/src/libtracker-data/tracker-data-update.c
==============================================================================
--- branches/libtracker-data/src/libtracker-data/tracker-data-update.c (original)
+++ branches/libtracker-data/src/libtracker-data/tracker-data-update.c Wed Nov 5 13:01:30 2008
@@ -32,7 +32,7 @@
#include "tracker-data-update.h"
guint32
-tracker_db_get_new_service_id (TrackerDBInterface *iface)
+tracker_data_update_get_new_service_id (TrackerDBInterface *iface)
{
guint32 files_max;
TrackerDBResultSet *result_set;
@@ -78,8 +78,8 @@
}
void
-tracker_db_increment_stats (TrackerDBInterface *iface,
- TrackerService *service)
+tracker_data_update_increment_stats (TrackerDBInterface *iface,
+ TrackerService *service)
{
const gchar *service_type, *parent;
@@ -102,8 +102,8 @@
}
void
-tracker_db_decrement_stats (TrackerDBInterface *iface,
- TrackerService *service)
+tracker_data_update_decrement_stats (TrackerDBInterface *iface,
+ TrackerService *service)
{
const gchar *service_type, *parent;
@@ -126,9 +126,9 @@
}
void
-tracker_db_create_event (TrackerDBInterface *iface,
- guint32 service_id,
- const gchar *type)
+tracker_data_update_create_event (TrackerDBInterface *iface,
+ guint32 service_id,
+ const gchar *type)
{
gchar *service_id_str;
@@ -219,11 +219,11 @@
}
gboolean
-tracker_db_create_service (TrackerService *service,
- guint32 id,
- const gchar *dirname,
- const gchar *basename,
- TrackerMetadata *metadata)
+tracker_data_update_create_service (TrackerService *service,
+ guint32 id,
+ const gchar *dirname,
+ const gchar *basename,
+ TrackerDataMetadata *metadata)
{
TrackerDBInterface *iface;
gchar *id_str, *service_type_id_str, *path;
@@ -250,12 +250,12 @@
dirname,
basename,
service_type_id_str,
- is_dir ? "Folder" : tracker_metadata_lookup (metadata, "File:Mime"),
- tracker_metadata_lookup (metadata, "File:Size"),
+ is_dir ? "Folder" : tracker_data_metadata_lookup (metadata, "File:Mime"),
+ tracker_data_metadata_lookup (metadata, "File:Size"),
is_dir ? "1" : "0",
is_symlink ? "1" : "0",
"0", /* Offset */
- tracker_metadata_lookup (metadata, "File:Modified"),
+ tracker_data_metadata_lookup (metadata, "File:Modified"),
"0", /* Aux ID */
NULL);
@@ -325,10 +325,10 @@
}
static void
-result_set_to_metadata (TrackerDBResultSet *result_set,
- TrackerMetadata *metadata,
- gboolean numeric,
- gboolean only_embedded)
+result_set_to_metadata (TrackerDBResultSet *result_set,
+ TrackerDataMetadata *metadata,
+ gboolean numeric,
+ gboolean only_embedded)
{
TrackerField *field;
gchar *value;
@@ -364,18 +364,18 @@
const GList *old_values;
new_values = NULL;
- old_values = tracker_metadata_lookup_multiple_values (metadata,
+ old_values = tracker_data_metadata_lookup_multiple_values (metadata,
tracker_field_get_name (field));
if (old_values) {
new_values = g_list_copy ((GList *) old_values);
}
new_values = g_list_prepend (new_values, value);
- tracker_metadata_insert_multiple_values (metadata,
+ tracker_data_metadata_insert_multiple_values (metadata,
tracker_field_get_name (field),
new_values);
} else {
- tracker_metadata_insert (metadata,
+ tracker_data_metadata_insert (metadata,
tracker_field_get_name (field),
value);
}
@@ -387,17 +387,17 @@
}
}
-TrackerMetadata *
+TrackerDataMetadata *
tracker_db_get_all_metadata (TrackerService *service,
guint32 service_id,
gboolean only_embedded)
{
- TrackerDBInterface *iface;
- TrackerDBResultSet *result_set = NULL;
- gchar *service_id_str;
- TrackerMetadata *metadata;
+ TrackerDBInterface *iface;
+ TrackerDBResultSet *result_set = NULL;
+ gchar *service_id_str;
+ TrackerDataMetadata *metadata;
- metadata = tracker_metadata_new ();
+ metadata = tracker_data_metadata_new ();
g_return_val_if_fail (TRACKER_IS_SERVICE (service), metadata);
@@ -429,8 +429,8 @@
}
void
-tracker_db_delete_service (TrackerService *service,
- guint32 service_id)
+tracker_data_update_delete_service (TrackerService *service,
+ guint32 service_id)
{
TrackerDBInterface *iface;
@@ -455,8 +455,8 @@
}
void
-tracker_db_delete_service_recursively (TrackerService *service,
- gchar *service_path)
+tracker_data_update_delete_service_recursively (TrackerService *service,
+ gchar *service_path)
{
TrackerDBInterface *iface;
gchar *str;
@@ -486,9 +486,9 @@
}
void
-tracker_db_move_service (TrackerService *service,
- const gchar *from,
- const gchar *to)
+tracker_data_update_move_service (TrackerService *service,
+ const gchar *from,
+ const gchar *to)
{
TrackerDBInterface *iface;
GError *error = NULL;
@@ -534,8 +534,8 @@
}
void
-tracker_db_delete_all_metadata (TrackerService *service,
- guint32 service_id)
+tracker_data_update_delete_all_metadata (TrackerService *service,
+ guint32 service_id)
{
TrackerDBInterface *iface;
gchar *service_id_str;
@@ -668,11 +668,11 @@
}
void
-tracker_db_set_metadata (TrackerService *service,
- guint32 id,
- TrackerField *field,
- const gchar *value,
- const gchar *parsed_value)
+tracker_data_update_set_metadata (TrackerService *service,
+ guint32 id,
+ TrackerField *field,
+ const gchar *value,
+ const gchar *parsed_value)
{
TrackerDBInterface *iface;
gint metadata_key;
@@ -730,7 +730,7 @@
break;
case TRACKER_FIELD_TYPE_FULLTEXT:
- tracker_db_set_text (service, id, value);
+ tracker_data_update_set_contents (service, id, value);
break;
case TRACKER_FIELD_TYPE_BLOB:
@@ -755,10 +755,10 @@
}
void
-tracker_db_delete_metadata (TrackerService *service,
- guint32 id,
- TrackerField *field,
- const gchar *value)
+tracker_data_update_delete_metadata (TrackerService *service,
+ guint32 id,
+ TrackerField *field,
+ const gchar *value)
{
TrackerDBInterface *iface;
gint metadata_key;
@@ -807,7 +807,7 @@
break;
case TRACKER_FIELD_TYPE_FULLTEXT:
- tracker_db_delete_text (service, id);
+ tracker_data_update_delete_contents (service, id);
break;
case TRACKER_FIELD_TYPE_BLOB:
@@ -830,9 +830,9 @@
}
void
-tracker_db_set_text (TrackerService *service,
- guint32 id,
- const gchar *text)
+tracker_data_update_set_contents (TrackerService *service,
+ guint32 id,
+ const gchar *text)
{
TrackerDBInterface *iface;
TrackerField *field;
@@ -884,8 +884,8 @@
}
void
-tracker_db_delete_text (TrackerService *service,
- guint32 id)
+tracker_data_update_delete_contents (TrackerService *service,
+ guint32 id)
{
TrackerDBInterface *iface;
TrackerField *field;
Modified: branches/libtracker-data/src/libtracker-data/tracker-data-update.h
==============================================================================
--- branches/libtracker-data/src/libtracker-data/tracker-data-update.h (original)
+++ branches/libtracker-data/src/libtracker-data/tracker-data-update.h Wed Nov 5 13:01:30 2008
@@ -28,71 +28,71 @@
G_BEGIN_DECLS
-guint32 tracker_db_get_new_service_id (TrackerDBInterface *iface);
-void tracker_db_increment_stats (TrackerDBInterface *iface,
- TrackerService *service);
-void tracker_db_decrement_stats (TrackerDBInterface *iface,
- TrackerService *service);
+guint32 tracker_data_update_get_new_service_id (TrackerDBInterface *iface);
+void tracker_data_update_increment_stats (TrackerDBInterface *iface,
+ TrackerService *service);
+void tracker_data_update_decrement_stats (TrackerDBInterface *iface,
+ TrackerService *service);
/* Using path */
-gboolean tracker_db_check_service (TrackerService *service,
- const gchar *dirname,
- const gchar *basename,
- guint32 *id,
- time_t *mtime);
-guint tracker_db_get_service_type (const gchar *dirname,
- const gchar *basename);
+gboolean tracker_db_check_service (TrackerService *service,
+ const gchar *dirname,
+ const gchar *basename,
+ guint32 *id,
+ time_t *mtime);
+guint tracker_db_get_service_type (const gchar *dirname,
+ const gchar *basename);
/* Services */
-gboolean tracker_db_create_service (TrackerService *service,
- guint32 id,
- const gchar *dirname,
- const gchar *basename,
- TrackerMetadata *metadata);
-void tracker_db_delete_service (TrackerService *service,
- guint32 id);
-void tracker_db_delete_service_recursively (TrackerService *service,
- gchar *service_path);
-void tracker_db_move_service (TrackerService *service,
- const gchar *from,
- const gchar *to);
+gboolean tracker_data_update_create_service (TrackerService *service,
+ guint32 id,
+ const gchar *dirname,
+ const gchar *basename,
+ TrackerDataMetadata *metadata);
+void tracker_data_update_delete_service (TrackerService *service,
+ guint32 id);
+void tracker_data_update_delete_service_recursively (TrackerService *service,
+ gchar *service_path);
+void tracker_data_update_move_service (TrackerService *service,
+ const gchar *from,
+ const gchar *to);
/* Metadata */
-void tracker_db_set_metadata (TrackerService *service,
- guint32 id,
- TrackerField *field,
- const gchar *value,
- const gchar *parsed_value);
-TrackerMetadata *tracker_db_get_all_metadata (TrackerService *service,
- guint32 id,
- gboolean only_embedded);
-gchar * tracker_db_get_parsed_metadata (TrackerService *service,
- guint32 id);
-gchar * tracker_db_get_unparsed_metadata (TrackerService *service,
- guint32 id);
-gchar ** tracker_db_get_property_values (TrackerService *service_def,
- guint32 id,
- TrackerField *field_def);
-void tracker_db_delete_all_metadata (TrackerService *service,
- guint32 id);
-void tracker_db_delete_metadata (TrackerService *service,
- guint32 id,
- TrackerField *field,
- const gchar *value);
+void tracker_data_update_set_metadata (TrackerService *service,
+ guint32 id,
+ TrackerField *field,
+ const gchar *value,
+ const gchar *parsed_value);
+TrackerDataMetadata *tracker_db_get_all_metadata (TrackerService *service,
+ guint32 id,
+ gboolean only_embedded);
+gchar * tracker_db_get_parsed_metadata (TrackerService *service,
+ guint32 id);
+gchar * tracker_db_get_unparsed_metadata (TrackerService *service,
+ guint32 id);
+gchar ** tracker_db_get_property_values (TrackerService *service_def,
+ guint32 id,
+ TrackerField *field_def);
+void tracker_data_update_delete_all_metadata (TrackerService *service,
+ guint32 id);
+void tracker_data_update_delete_metadata (TrackerService *service,
+ guint32 id,
+ TrackerField *field,
+ const gchar *value);
/* Contents */
-void tracker_db_set_text (TrackerService *service,
- guint32 id,
- const gchar *text);
-gchar * tracker_db_get_text (TrackerService *service,
- guint32 id);
-void tracker_db_delete_text (TrackerService *service,
- guint32 id);
+void tracker_data_update_set_contents (TrackerService *service,
+ guint32 id,
+ const gchar *text);
+gchar * tracker_db_get_text (TrackerService *service,
+ guint32 id);
+void tracker_data_update_delete_contents (TrackerService *service,
+ guint32 id);
/* Events */
-void tracker_db_create_event (TrackerDBInterface *iface,
- guint32 service_id,
- const gchar *type);
+void tracker_data_update_create_event (TrackerDBInterface *iface,
+ guint32 service_id,
+ const gchar *type);
G_END_DECLS
Modified: branches/libtracker-data/src/tracker-indexer/modules/applications.c
==============================================================================
--- branches/libtracker-data/src/tracker-indexer/modules/applications.c (original)
+++ branches/libtracker-data/src/tracker-indexer/modules/applications.c Wed Nov 5 13:01:30 2008
@@ -51,7 +51,7 @@
}
static void
-insert_data_from_desktop_file (TrackerMetadata *metadata,
+insert_data_from_desktop_file (TrackerDataMetadata *metadata,
const gchar *metadata_key,
GKeyFile *desktop_file,
const gchar *key,
@@ -66,12 +66,12 @@
}
if (str) {
- tracker_metadata_insert (metadata, metadata_key, str);
+ tracker_data_metadata_insert (metadata, metadata_key, str);
}
}
static void
-insert_list_from_desktop_file (TrackerMetadata *metadata,
+insert_list_from_desktop_file (TrackerDataMetadata *metadata,
const gchar *metadata_key,
GKeyFile *desktop_file,
const gchar *key,
@@ -96,14 +96,14 @@
list = g_list_reverse (list);
g_free (arr);
- tracker_metadata_insert_multiple_values (metadata, metadata_key, list);
+ tracker_data_metadata_insert_multiple_values (metadata, metadata_key, list);
}
}
-TrackerMetadata *
+TrackerDataMetadata *
tracker_module_file_get_metadata (TrackerFile *file)
{
- TrackerMetadata *metadata;
+ TrackerDataMetadata *metadata;
GKeyFile *key_file;
gchar *type, *filename;
@@ -136,7 +136,7 @@
}
/* Begin collecting data */
- metadata = tracker_metadata_new ();
+ metadata = tracker_data_metadata_new ();
insert_data_from_desktop_file (metadata, METADATA_APP_NAME, key_file, KEY_NAME, FALSE);
insert_data_from_desktop_file (metadata, METADATA_APP_DISPLAY_NAME, key_file, KEY_NAME, TRUE);
@@ -149,7 +149,7 @@
insert_list_from_desktop_file (metadata, METADATA_APP_CATEGORIES, key_file, KEY_CATEGORIES, FALSE);
filename = g_filename_display_basename (file->path);
- tracker_metadata_insert (metadata, METADATA_FILE_NAME, filename);
+ tracker_data_metadata_insert (metadata, METADATA_FILE_NAME, filename);
g_key_file_free (key_file);
g_free (type);
Modified: branches/libtracker-data/src/tracker-indexer/modules/evolution.c
==============================================================================
--- branches/libtracker-data/src/tracker-indexer/modules/evolution.c (original)
+++ branches/libtracker-data/src/tracker-indexer/modules/evolution.c Wed Nov 5 13:01:30 2008
@@ -708,10 +708,10 @@
return g_list_reverse (list);
}
-static TrackerMetadata *
+static TrackerDataMetadata *
get_metadata_for_data_wrapper (GMimeDataWrapper *wrapper)
{
- TrackerMetadata *metadata;
+ TrackerDataMetadata *metadata;
GMimeStream *stream;
gchar *path;
gint fd;
@@ -736,12 +736,12 @@
return metadata;
}
-static TrackerMetadata *
+static TrackerDataMetadata *
get_metadata_for_mbox_attachment (TrackerFile *file,
GMimeMessage *message,
GMimePart *part)
{
- TrackerMetadata *metadata;
+ TrackerDataMetadata *metadata;
GMimeDataWrapper *content;
content = g_mime_part_get_content_object (part);
@@ -758,8 +758,8 @@
get_mbox_attachment_uri (file, message, part,
&dirname, &basename);
- tracker_metadata_insert (metadata, METADATA_FILE_PATH, dirname);
- tracker_metadata_insert (metadata, METADATA_FILE_NAME, basename);
+ tracker_data_metadata_insert (metadata, METADATA_FILE_PATH, dirname);
+ tracker_data_metadata_insert (metadata, METADATA_FILE_NAME, basename);
}
g_object_unref (content);
@@ -767,12 +767,12 @@
return metadata;
}
-static TrackerMetadata *
+static TrackerDataMetadata *
get_metadata_for_mbox (TrackerFile *file)
{
EvolutionLocalData *data;
GMimeMessage *message;
- TrackerMetadata *metadata;
+ TrackerDataMetadata *metadata;
gchar *dirname, *basename;
time_t date;
GList *list;
@@ -797,26 +797,26 @@
return get_metadata_for_mbox_attachment (file, message, data->current_mime_part->data);
}
- metadata = tracker_metadata_new ();
+ metadata = tracker_data_metadata_new ();
get_mbox_uri (file, message, &dirname, &basename);
- tracker_metadata_insert (metadata, METADATA_FILE_PATH, dirname);
- tracker_metadata_insert (metadata, METADATA_FILE_NAME, basename);
+ tracker_data_metadata_insert (metadata, METADATA_FILE_PATH, dirname);
+ tracker_data_metadata_insert (metadata, METADATA_FILE_NAME, basename);
g_mime_message_get_date (message, &date, NULL);
- tracker_metadata_insert (metadata, METADATA_EMAIL_DATE,
+ tracker_data_metadata_insert (metadata, METADATA_EMAIL_DATE,
tracker_guint_to_string (date));
- tracker_metadata_insert (metadata, METADATA_EMAIL_SENDER,
+ tracker_data_metadata_insert (metadata, METADATA_EMAIL_SENDER,
g_strdup (g_mime_message_get_sender (message)));
- tracker_metadata_insert (metadata, METADATA_EMAIL_SUBJECT,
+ tracker_data_metadata_insert (metadata, METADATA_EMAIL_SUBJECT,
g_strdup (g_mime_message_get_subject (message)));
list = get_mbox_recipient_list (message, GMIME_RECIPIENT_TYPE_TO);
- tracker_metadata_insert_multiple_values (metadata, METADATA_EMAIL_SENT_TO, list);
+ tracker_data_metadata_insert_multiple_values (metadata, METADATA_EMAIL_SENT_TO, list);
list = get_mbox_recipient_list (message, GMIME_RECIPIENT_TYPE_CC);
- tracker_metadata_insert_multiple_values (metadata, METADATA_EMAIL_CC, list);
+ tracker_data_metadata_insert_multiple_values (metadata, METADATA_EMAIL_CC, list);
return metadata;
}
@@ -1061,11 +1061,11 @@
return message_path;
}
-static TrackerMetadata *
+static TrackerDataMetadata *
get_metadata_for_imap_attachment (TrackerFile *file,
const gchar *mime_file)
{
- TrackerMetadata *metadata;
+ TrackerDataMetadata *metadata;
GMimeStream *stream;
GMimeDataWrapper *wrapper;
GMimePartEncodingType encoding;
@@ -1103,8 +1103,8 @@
data->cur_message_uid,
&dirname, &basename);
- tracker_metadata_insert (metadata, METADATA_FILE_NAME, g_strdup (name));
- tracker_metadata_insert (metadata, METADATA_FILE_PATH,
+ tracker_data_metadata_insert (metadata, METADATA_FILE_NAME, g_strdup (name));
+ tracker_data_metadata_insert (metadata, METADATA_FILE_PATH,
g_strdup_printf ("%s/%s", dirname, basename));
g_free (dirname);
@@ -1119,11 +1119,11 @@
return metadata;
}
-static TrackerMetadata *
+static TrackerDataMetadata *
get_metadata_for_imap (TrackerFile *file)
{
EvolutionImapData *data;
- TrackerMetadata *metadata = NULL;
+ TrackerDataMetadata *metadata = NULL;
gchar *dirname, *basename;
gchar *subject, *from, *to, *cc;
gint32 i, count, flags;
@@ -1173,23 +1173,23 @@
}
if (!deleted) {
- metadata = tracker_metadata_new ();
+ metadata = tracker_data_metadata_new ();
get_imap_uri (file, data->cur_message_uid, &dirname, &basename);
- tracker_metadata_insert (metadata, METADATA_FILE_PATH, dirname);
- tracker_metadata_insert (metadata, METADATA_FILE_NAME, basename);
+ tracker_data_metadata_insert (metadata, METADATA_FILE_PATH, dirname);
+ tracker_data_metadata_insert (metadata, METADATA_FILE_NAME, basename);
- tracker_metadata_insert (metadata, METADATA_EMAIL_DATE,
+ tracker_data_metadata_insert (metadata, METADATA_EMAIL_DATE,
tracker_guint_to_string (date));
- tracker_metadata_insert (metadata, METADATA_EMAIL_SENDER, from);
- tracker_metadata_insert (metadata, METADATA_EMAIL_SUBJECT, subject);
+ tracker_data_metadata_insert (metadata, METADATA_EMAIL_SENDER, from);
+ tracker_data_metadata_insert (metadata, METADATA_EMAIL_SUBJECT, subject);
list = get_imap_recipient_list (to);
- tracker_metadata_insert_multiple_values (metadata, METADATA_EMAIL_SENT_TO, list);
+ tracker_data_metadata_insert_multiple_values (metadata, METADATA_EMAIL_SENT_TO, list);
list = get_imap_recipient_list (cc);
- tracker_metadata_insert_multiple_values (metadata, METADATA_EMAIL_CC, list);
+ tracker_data_metadata_insert_multiple_values (metadata, METADATA_EMAIL_CC, list);
}
g_free (to);
@@ -1258,7 +1258,7 @@
corruption:
/* assume corruption */
if (metadata) {
- tracker_metadata_free (metadata);
+ tracker_data_metadata_free (metadata);
}
return NULL;
@@ -1344,7 +1344,7 @@
return g_strdup ("EvolutionEmails");
}
-TrackerMetadata *
+TrackerDataMetadata *
tracker_module_file_get_metadata (TrackerFile *file)
{
EvolutionFileData *data;
Modified: branches/libtracker-data/src/tracker-indexer/modules/files.c
==============================================================================
--- branches/libtracker-data/src/tracker-indexer/modules/files.c (original)
+++ branches/libtracker-data/src/tracker-indexer/modules/files.c Wed Nov 5 13:01:30 2008
@@ -139,7 +139,7 @@
#endif /* ENABLE_FILE_EXCLUDE_CHECKING */
-TrackerMetadata *
+TrackerDataMetadata *
tracker_module_file_get_metadata (TrackerFile *file)
{
#ifdef ENABLE_FILE_EXCLUDE_CHECKING
Modified: branches/libtracker-data/src/tracker-indexer/tracker-indexer-module.c
==============================================================================
--- branches/libtracker-data/src/tracker-indexer/tracker-indexer-module.c (original)
+++ branches/libtracker-data/src/tracker-indexer/tracker-indexer-module.c Wed Nov 5 13:01:30 2008
@@ -175,7 +175,7 @@
}
-TrackerMetadata *
+TrackerDataMetadata *
tracker_indexer_module_file_get_metadata (GModule *module,
TrackerFile *file)
{
Modified: branches/libtracker-data/src/tracker-indexer/tracker-indexer-module.h
==============================================================================
--- branches/libtracker-data/src/tracker-indexer/tracker-indexer-module.h (original)
+++ branches/libtracker-data/src/tracker-indexer/tracker-indexer-module.h Wed Nov 5 13:01:30 2008
@@ -46,7 +46,7 @@
gchar **basename);
gchar * tracker_indexer_module_file_get_service_type (GModule *module,
TrackerFile *file);
-TrackerMetadata * tracker_indexer_module_file_get_metadata (GModule *module,
+TrackerDataMetadata * tracker_indexer_module_file_get_metadata (GModule *module,
TrackerFile *file);
gchar * tracker_indexer_module_file_get_text (GModule *module,
TrackerFile *file);
Modified: branches/libtracker-data/src/tracker-indexer/tracker-indexer.c
==============================================================================
--- branches/libtracker-data/src/tracker-indexer/tracker-indexer.c (original)
+++ branches/libtracker-data/src/tracker-indexer/tracker-indexer.c Wed Nov 5 13:01:30 2008
@@ -929,9 +929,9 @@
}
if (data->add) {
- tracker_db_set_metadata (data->service, data->id, field, (gchar *) value, parsed_value);
+ tracker_data_update_set_metadata (data->service, data->id, field, (gchar *) value, parsed_value);
} else {
- tracker_db_delete_metadata (data->service, data->id, field, (gchar *)value);
+ tracker_data_update_delete_metadata (data->service, data->id, field, (gchar *)value);
}
g_strfreev (arr);
@@ -976,7 +976,7 @@
index_metadata (TrackerIndexer *indexer,
guint32 id,
TrackerService *service,
- TrackerMetadata *metadata)
+ TrackerDataMetadata *metadata)
{
MetadataForeachData data;
@@ -986,7 +986,7 @@
data.id = id;
data.add = TRUE;
- tracker_metadata_foreach (metadata, index_metadata_foreach, &data);
+ tracker_data_metadata_foreach (metadata, index_metadata_foreach, &data);
schedule_flush (indexer, FALSE);
}
@@ -995,7 +995,7 @@
unindex_metadata (TrackerIndexer *indexer,
guint32 id,
TrackerService *service,
- TrackerMetadata *metadata)
+ TrackerDataMetadata *metadata)
{
MetadataForeachData data;
@@ -1005,7 +1005,7 @@
data.id = id;
data.add = FALSE;
- tracker_metadata_foreach (metadata, index_metadata_foreach, &data);
+ tracker_data_metadata_foreach (metadata, index_metadata_foreach, &data);
schedule_flush (indexer, FALSE);
}
@@ -1245,11 +1245,11 @@
/* Remove old text and set new one in the db */
if (old_text) {
- tracker_db_delete_text (service, id);
+ tracker_data_update_delete_contents (service, id);
}
if (new_text) {
- tracker_db_set_text (service, id, new_text);
+ tracker_data_update_set_contents (service, id, new_text);
}
g_hash_table_unref (old_words);
@@ -1261,7 +1261,7 @@
PathInfo *info,
const gchar *dirname,
const gchar *basename,
- TrackerMetadata *metadata)
+ TrackerDataMetadata *metadata)
{
TrackerService *service;
gchar *service_type;
@@ -1283,7 +1283,7 @@
}
if (tracker_db_check_service (service, dirname, basename, &id, NULL)) {
- TrackerMetadata *old_metadata;
+ TrackerDataMetadata *old_metadata;
gchar *old_text;
gchar *new_text;
@@ -1309,7 +1309,7 @@
item_update_content (indexer, service, id, old_text, new_text);
g_free (old_text);
g_free (new_text);
- tracker_metadata_free (old_metadata);
+ tracker_data_metadata_free (old_metadata);
return;
}
@@ -1319,16 +1319,16 @@
basename);
/* Service wasn't previously indexed */
- id = tracker_db_get_new_service_id (indexer->private->common);
+ id = tracker_data_update_get_new_service_id (indexer->private->common);
- tracker_db_create_service (service,
+ tracker_data_update_create_service (service,
id,
dirname,
basename,
metadata);
- tracker_db_create_event (indexer->private->cache, id, "Create");
- tracker_db_increment_stats (indexer->private->common, service);
+ tracker_data_update_create_event (indexer->private->cache, id, "Create");
+ tracker_data_update_increment_stats (indexer->private->common, service);
index_metadata (indexer, id, service, metadata);
@@ -1343,7 +1343,7 @@
1);
/* Save in the DB */
- tracker_db_set_text (service, id, text);
+ tracker_data_update_set_contents (service, id, text);
g_free (text);
}
}
@@ -1355,7 +1355,7 @@
const gchar *basename)
{
TrackerService *service;
- TrackerMetadata *metadata;
+ TrackerDataMetadata *metadata;
gchar *service_type;
guint32 id;
@@ -1388,7 +1388,7 @@
return;
}
- tracker_db_move_service (service,
+ tracker_data_update_move_service (service,
info->file->path,
info->other_file->path);
@@ -1458,7 +1458,7 @@
content,
1);
g_free (content);
- tracker_db_delete_text (service, service_id);
+ tracker_data_update_delete_contents (service, service_id);
}
/* Get metadata from DB to remove it from the index */
@@ -1489,11 +1489,11 @@
basename,
NULL);
- tracker_db_delete_service (service, service_id);
- tracker_db_delete_service_recursively (service, service_path);
- tracker_db_delete_all_metadata (service, service_id);
+ tracker_data_update_delete_service (service, service_id);
+ tracker_data_update_delete_service_recursively (service, service_path);
+ tracker_data_update_delete_all_metadata (service, service_id);
- tracker_db_decrement_stats (indexer->private->common, service);
+ tracker_data_update_decrement_stats (indexer->private->common, service);
g_free (service_path);
}
@@ -1605,7 +1605,7 @@
old_contents[0],
tracker_field_get_weight (field));
}
- tracker_db_delete_metadata (service, service_id, field, old_contents[0]);
+ tracker_data_update_delete_metadata (service, service_id, field, old_contents[0]);
}
}
@@ -1623,7 +1623,7 @@
continue;
}
- tracker_db_set_metadata (service, service_id, field, values[i], NULL);
+ tracker_data_update_set_metadata (service, service_id, field, values[i], NULL);
setted_values [j++] = values[i];
}
setted_values [j] = NULL;
@@ -1719,7 +1719,7 @@
*/
if (g_strv_length (values) > 0) {
for (i = 0; values[i] != NULL; i++) {
- tracker_db_delete_metadata (service,
+ tracker_data_update_delete_metadata (service,
service_id,
field,
values[i]);
@@ -1732,7 +1732,7 @@
service_id,
field);
if (old_contents) {
- tracker_db_delete_metadata (service,
+ tracker_data_update_delete_metadata (service,
service_id,
field,
NULL);
@@ -1940,7 +1940,7 @@
process_file (TrackerIndexer *indexer,
PathInfo *info)
{
- TrackerMetadata *metadata;
+ TrackerDataMetadata *metadata;
gchar *dirname;
gchar *basename;
@@ -2006,7 +2006,7 @@
if (metadata) {
item_add_or_update (indexer, info, dirname, basename, metadata);
- tracker_metadata_free (metadata);
+ tracker_data_metadata_free (metadata);
} else {
item_remove (indexer, info, dirname, basename);
}
Modified: branches/libtracker-data/src/tracker-indexer/tracker-metadata-utils.c
==============================================================================
--- branches/libtracker-data/src/tracker-indexer/tracker-metadata-utils.c (original)
+++ branches/libtracker-data/src/tracker-indexer/tracker-metadata-utils.c Wed Nov 5 13:01:30 2008
@@ -316,9 +316,9 @@
}
static void
-metadata_utils_get_embedded (const char *path,
- const char *mime_type,
- TrackerMetadata *metadata)
+metadata_utils_get_embedded (const char *path,
+ const char *mime_type,
+ TrackerDataMetadata *metadata)
{
gchar **values;
gchar *service_type;
@@ -373,7 +373,7 @@
if (!utf_value)
continue;
- tracker_metadata_insert (metadata, name, utf_value);
+ tracker_data_metadata_insert (metadata, name, utf_value);
}
g_strfreev (values);
@@ -910,15 +910,15 @@
* tracker_metadata_utils_get_data:
* @path: Path to a local file
*
- * Returns a #TrackerMetadata filled with the most generic
+ * Returns a #TrackerDataMetadata filled with the most generic
* metadata for files, such as file size, MIME type, mtime...
*
- * Returns: A newly created #TrackerMetadata, or %NULL if the file is not found.
+ * Returns: A newly created #TrackerDataMetadata, or %NULL if the file is not found.
**/
-TrackerMetadata *
+TrackerDataMetadata *
tracker_metadata_utils_get_data (const gchar *path)
{
- TrackerMetadata *metadata;
+ TrackerDataMetadata *metadata;
struct stat st;
const gchar *ext;
gchar *mime_type;
@@ -927,22 +927,22 @@
return NULL;
}
- metadata = tracker_metadata_new ();
+ metadata = tracker_data_metadata_new ();
ext = strrchr (path, '.');
if (ext) {
- tracker_metadata_insert (metadata, METADATA_FILE_EXT, g_strdup (ext + 1));
+ tracker_data_metadata_insert (metadata, METADATA_FILE_EXT, g_strdup (ext + 1));
}
mime_type = tracker_file_get_mime_type (path);
- tracker_metadata_insert (metadata, METADATA_FILE_NAME,
+ tracker_data_metadata_insert (metadata, METADATA_FILE_NAME,
g_filename_display_basename (path));
- tracker_metadata_insert (metadata, METADATA_FILE_PATH,
+ tracker_data_metadata_insert (metadata, METADATA_FILE_PATH,
g_path_get_dirname (path));
- tracker_metadata_insert (metadata, METADATA_FILE_NAME_DELIMITED,
+ tracker_data_metadata_insert (metadata, METADATA_FILE_NAME_DELIMITED,
g_filename_to_utf8 (path, -1, NULL, NULL, NULL));
- tracker_metadata_insert (metadata, METADATA_FILE_MIMETYPE,
+ tracker_data_metadata_insert (metadata, METADATA_FILE_MIMETYPE,
mime_type);
if (mime_type) {
@@ -957,17 +957,17 @@
gchar *link_path;
link_path = g_file_read_link (path, NULL);
- tracker_metadata_insert (metadata, METADATA_FILE_LINK,
+ tracker_data_metadata_insert (metadata, METADATA_FILE_LINK,
g_filename_to_utf8 (link_path, -1, NULL, NULL, NULL));
g_free (link_path);
}
/* FIXME: These should be dealt directly as integer/times/whatever, not strings */
- tracker_metadata_insert (metadata, METADATA_FILE_SIZE,
+ tracker_data_metadata_insert (metadata, METADATA_FILE_SIZE,
tracker_guint_to_string (st.st_size));
- tracker_metadata_insert (metadata, METADATA_FILE_MODIFIED,
+ tracker_data_metadata_insert (metadata, METADATA_FILE_MODIFIED,
tracker_date_to_string (st.st_mtime));
- tracker_metadata_insert (metadata, METADATA_FILE_ACCESSED,
+ tracker_data_metadata_insert (metadata, METADATA_FILE_ACCESSED,
tracker_date_to_string (st.st_atime));
metadata_utils_get_embedded (path, mime_type, metadata);
Modified: branches/libtracker-data/src/tracker-indexer/tracker-metadata-utils.h
==============================================================================
--- branches/libtracker-data/src/tracker-indexer/tracker-metadata-utils.h (original)
+++ branches/libtracker-data/src/tracker-indexer/tracker-metadata-utils.h Wed Nov 5 13:01:30 2008
@@ -26,8 +26,8 @@
G_BEGIN_DECLS
-TrackerMetadata *tracker_metadata_utils_get_data (const gchar *path);
-gchar * tracker_metadata_utils_get_text (const gchar *path);
+TrackerDataMetadata *tracker_metadata_utils_get_data (const gchar *path);
+gchar * tracker_metadata_utils_get_text (const gchar *path);
G_END_DECLS
Modified: branches/libtracker-data/src/tracker-indexer/tracker-module.h
==============================================================================
--- branches/libtracker-data/src/tracker-indexer/tracker-module.h (original)
+++ branches/libtracker-data/src/tracker-indexer/tracker-module.h Wed Nov 5 13:01:30 2008
@@ -48,7 +48,7 @@
gchar **dirname,
gchar **basename);
-typedef TrackerMetadata * (* TrackerModuleFileGetMetadataFunc) (TrackerFile *file);
+typedef TrackerDataMetadata * (* TrackerModuleFileGetMetadataFunc) (TrackerFile *file);
typedef gchar * (* TrackerModuleFileGetText) (TrackerFile *path);
typedef gboolean (* TrackerModuleFileIterContents) (TrackerFile *path);
@@ -62,7 +62,7 @@
void tracker_module_file_get_uri (TrackerFile *file,
gchar **dirname,
gchar **basename);
-TrackerMetadata * tracker_module_file_get_metadata (TrackerFile *file);
+TrackerDataMetadata * tracker_module_file_get_metadata (TrackerFile *file);
gchar * tracker_module_file_get_text (TrackerFile *file);
gboolean tracker_module_file_iter_contents (TrackerFile *file);
Modified: branches/libtracker-data/src/trackerd/tracker-daemon.c
==============================================================================
--- branches/libtracker-data/src/trackerd/tracker-daemon.c (original)
+++ branches/libtracker-data/src/trackerd/tracker-daemon.c Wed Nov 5 13:01:30 2008
@@ -172,7 +172,7 @@
* lookup the in a to compare in b, just compare index based.
* Maybe we want to change this nonetheless later?
*/
- result_set = tracker_db_exec_proc (iface, "GetStats", 0);
+ result_set = tracker_data_manager_exec_proc (iface, "GetStats", 0);
new_stats = tracker_dbus_query_result_to_ptr_array (result_set);
if (result_set) {
@@ -262,7 +262,7 @@
iface = tracker_db_manager_get_db_interface_by_service (TRACKER_DB_FOR_FILE_SERVICE);
- result_set = tracker_db_exec_proc (iface, "GetStats", 0);
+ result_set = tracker_data_manager_exec_proc (iface, "GetStats", 0);
priv->last_stats = tracker_dbus_query_result_to_ptr_array (result_set);
if (result_set) {
@@ -449,7 +449,7 @@
iface = tracker_db_manager_get_db_interface_by_service (TRACKER_DB_FOR_FILE_SERVICE);
- result_set = tracker_db_exec_proc (iface, "GetServices", 0);
+ result_set = tracker_data_manager_exec_proc (iface, "GetServices", 0);
values = tracker_dbus_query_result_to_hash_table (result_set);
if (result_set) {
@@ -488,7 +488,7 @@
iface = tracker_db_manager_get_db_interface_by_service (TRACKER_DB_FOR_FILE_SERVICE);
- result_set = tracker_db_exec_proc (iface, "GetStats", 0);
+ result_set = tracker_data_manager_exec_proc (iface, "GetStats", 0);
values = tracker_dbus_query_result_to_ptr_array (result_set);
if (result_set) {
Modified: branches/libtracker-data/src/trackerd/tracker-files.c
==============================================================================
--- branches/libtracker-data/src/trackerd/tracker-files.c (original)
+++ branches/libtracker-data/src/trackerd/tracker-files.c Wed Nov 5 13:01:30 2008
@@ -383,7 +383,7 @@
iface = tracker_db_manager_get_db_interface_by_service (service_type);
service_id_str = g_strdup_printf ("%d", service_id);
- result_set = tracker_db_exec_proc (iface,
+ result_set = tracker_data_manager_exec_proc (iface,
"GetFileContents",
offset_str,
max_length_str,
@@ -679,7 +679,7 @@
tracker_file_get_path_and_name (uri, &path, &name);
- result_set = tracker_db_exec_proc (iface,
+ result_set = tracker_data_manager_exec_proc (iface,
"GetFileMTime",
path,
name,
Modified: branches/libtracker-data/src/trackerd/tracker-main.c
==============================================================================
--- branches/libtracker-data/src/trackerd/tracker-main.c (original)
+++ branches/libtracker-data/src/trackerd/tracker-main.c Wed Nov 5 13:01:30 2008
@@ -500,7 +500,7 @@
iface = tracker_db_manager_get_db_interface_by_service (TRACKER_DB_FOR_FILE_SERVICE);
g_message ("*** DELETING STATS *** ");
- tracker_db_exec_no_reply (iface,
+ tracker_data_manager_exec_no_reply (iface,
"update ServiceTypes set TypeCount = 0 where Embedded = 1");
}
@@ -508,17 +508,17 @@
/* Check db integrity if not previously shut down cleanly */
if (!tracker_status_get_is_readonly () &&
!tracker_status_get_is_first_time_index () &&
- tracker_db_get_option_int ("IntegrityCheck") == 1) {
+ tracker_data_manager_get_db_option_int ("IntegrityCheck") == 1) {
g_message ("Performing integrity check as the daemon was not shutdown cleanly");
/* FIXME: Finish */
}
if (!tracker_status_get_is_readonly ()) {
- tracker_db_set_option_int ("IntegrityCheck", 1);
+ tracker_data_manager_set_db_option_int ("IntegrityCheck", 1);
}
if (tracker_status_get_is_first_time_index ()) {
- tracker_db_set_option_int ("InitialIndex", 1);
+ tracker_data_manager_set_db_option_int ("InitialIndex", 1);
}
return TRUE;
@@ -534,7 +534,7 @@
shutdown_databases (void)
{
/* Reset integrity status as threads have closed cleanly */
- tracker_db_set_option_int ("IntegrityCheck", 0);
+ tracker_data_manager_set_db_option_int ("IntegrityCheck", 0);
}
static void
@@ -859,7 +859,7 @@
return EXIT_FAILURE;
}
- tracker_db_init (config, language, file_index, email_index);
+ tracker_data_manager_init (config, language, file_index, email_index);
tracker_xesam_manager_init ();
private->processor = tracker_processor_new (config, hal);
@@ -951,7 +951,7 @@
tracker_dbus_shutdown ();
tracker_db_manager_shutdown ();
tracker_db_index_manager_shutdown ();
- tracker_db_shutdown ();
+ tracker_data_manager_shutdown ();
tracker_module_config_shutdown ();
tracker_nfs_lock_shutdown ();
tracker_status_shutdown ();
Modified: branches/libtracker-data/src/trackerd/tracker-search.c
==============================================================================
--- branches/libtracker-data/src/trackerd/tracker-search.c (original)
+++ branches/libtracker-data/src/trackerd/tracker-search.c Wed Nov 5 13:01:30 2008
@@ -798,7 +798,7 @@
return;
}
- result_set = tracker_db_exec_proc (iface,
+ result_set = tracker_data_manager_exec_proc (iface,
"GetAllContents",
service_id,
NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]