tracker r2461 - in branches/libtracker-data: . src/libtracker-data src/tracker-indexer src/trackerd
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2461 - in branches/libtracker-data: . src/libtracker-data src/tracker-indexer src/trackerd
- Date: Thu, 6 Nov 2008 09:45:07 +0000 (UTC)
Author: juergbi
Date: Thu Nov 6 09:45:07 2008
New Revision: 2461
URL: http://svn.gnome.org/viewvc/tracker?rev=2461&view=rev
Log:
2008-11-06 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-query.c:
* src/libtracker-data/tracker-data-query.h:
* src/libtracker-data/tracker-data-update.c:
* src/libtracker-data/tracker-data-update.h:
* src/libtracker-data/tracker-rdf-query.c:
* src/libtracker-data/tracker-xesam-query.c:
* src/tracker-indexer/tracker-indexer.c:
* src/trackerd/tracker-files.c:
* src/trackerd/tracker-keywords.c:
* src/trackerd/tracker-metadata.c:
* src/trackerd/tracker-search.c:
Use tracker_data_query as function namespace
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-query.c
branches/libtracker-data/src/libtracker-data/tracker-data-query.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/libtracker-data/tracker-rdf-query.c
branches/libtracker-data/src/libtracker-data/tracker-xesam-query.c
branches/libtracker-data/src/tracker-indexer/tracker-indexer.c
branches/libtracker-data/src/trackerd/tracker-files.c
branches/libtracker-data/src/trackerd/tracker-keywords.c
branches/libtracker-data/src/trackerd/tracker-metadata.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 Thu Nov 6 09:45:07 2008
@@ -277,7 +277,7 @@
}
gchar *
-tracker_db_metadata_get_related_names (TrackerDBInterface *iface,
+tracker_data_query_metadata_field_related_names (TrackerDBInterface *iface,
const gchar *name)
{
TrackerDBResultSet *result_set;
@@ -366,7 +366,7 @@
}
const gchar *
-tracker_db_metadata_get_table (TrackerFieldType type)
+tracker_data_query_metadata_field_table (TrackerFieldType type)
{
switch (type) {
case TRACKER_FIELD_TYPE_INDEX:
@@ -726,7 +726,7 @@
for (l = fields; l; l = l->next) {
gchar *field_name;
- field_name = tracker_db_metadata_get_related_names (iface,
+ field_name = tracker_data_query_metadata_field_related_names (iface,
tracker_field_data_get_field_name (l->data));
g_string_append_printf (sql_join,
"INNER JOIN 'files-meta'.%s %s ON (X.ServiceID = %s.ServiceID AND %s.MetaDataID in (%s))\n ",
@@ -793,7 +793,7 @@
NULL);
alias = g_strdup_printf ("M%d", field_count);
- table_name = tracker_db_metadata_get_table (tracker_field_get_data_type (def));
+ table_name = tracker_data_query_metadata_field_table (tracker_field_get_data_type (def));
g_debug ("Field_name: %s :table_name is: %s for data_type: %i",
field_name,
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 Thu Nov 6 09:45:07 2008
@@ -64,9 +64,9 @@
gint value);
/* Metadata API */
-gchar * tracker_db_metadata_get_related_names (TrackerDBInterface *iface,
+gchar * tracker_data_query_metadata_field_related_names (TrackerDBInterface *iface,
const gchar *name);
-const gchar * tracker_db_metadata_get_table (TrackerFieldType type);
+const gchar * tracker_data_query_metadata_field_table (TrackerFieldType type);
/* Miscellaneous API */
gchar * tracker_db_get_field_name (const gchar *service,
Modified: branches/libtracker-data/src/libtracker-data/tracker-data-query.c
==============================================================================
--- branches/libtracker-data/src/libtracker-data/tracker-data-query.c (original)
+++ branches/libtracker-data/src/libtracker-data/tracker-data-query.c Thu Nov 6 09:45:07 2008
@@ -42,9 +42,9 @@
#include "tracker-data-query.h"
TrackerDBResultSet *
-tracker_db_metadata_get (TrackerDBInterface *iface,
- const gchar *id,
- const gchar *key)
+tracker_data_query_metadata_field (TrackerDBInterface *iface,
+ const gchar *id,
+ const gchar *key)
{
TrackerField *def;
const gchar *proc = NULL;
@@ -120,8 +120,8 @@
}
GPtrArray *
-tracker_db_metadata_get_all (const gchar *service_type,
- const gchar *service_id)
+tracker_data_query_all_metadata (const gchar *service_type,
+ const gchar *service_id)
{
TrackerDBInterface *iface;
TrackerDBResultSet *result_set;
@@ -149,10 +149,10 @@
TrackerDBResultSet *
-tracker_db_metadata_get_array (TrackerDBInterface *iface,
- const gchar *service_type,
- const gchar *service_id,
- gchar ** keys)
+tracker_data_query_metadata_fields (TrackerDBInterface *iface,
+ const gchar *service_type,
+ const gchar *service_id,
+ gchar **keys)
{
TrackerDBResultSet *result_set;
GString *sql, *sql_join;
@@ -218,56 +218,12 @@
}
-/* Gets specified metadata value as a single row (multple values for a
- * metadata type are returned delimited by "|" )
- */
-gchar *
-tracker_db_metadata_get_delimited (TrackerDBInterface *iface,
- const gchar *id,
- const gchar *key)
-{
- TrackerDBResultSet *result_set;
- GString *s = NULL;
-
- g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
- g_return_val_if_fail (id != NULL, NULL);
- g_return_val_if_fail (key != NULL, NULL);
-
- result_set = tracker_db_metadata_get (iface, id, key);
-
- if (result_set) {
- gchar *str;
- gboolean valid = TRUE;
-
- while (valid) {
- tracker_db_result_set_get (result_set, 0, &str, -1);
-
- if (s) {
- g_string_append_printf (s, "|%s", str);
- } else {
- s = g_string_new (str);
- }
-
- g_free (str);
- valid = tracker_db_result_set_iter_next (result_set);
- }
-
- g_object_unref (result_set);
- }
-
- if (s) {
- return g_string_free (s, FALSE);
- } else {
- return NULL;
- }
-}
-
/*
* Obtain the concrete service type name for the file id.
*/
gchar *
-tracker_db_service_get_by_entity (TrackerDBInterface *iface,
- const gchar *id)
+tracker_data_query_service_type_by_id (TrackerDBInterface *iface,
+ const gchar *id)
{
TrackerDBResultSet *result_set;
gint service_type_id;
@@ -293,8 +249,8 @@
guint32
-tracker_db_file_get_id (const gchar *service_type,
- const gchar *uri)
+tracker_data_query_file_id (const gchar *service_type,
+ const gchar *uri)
{
TrackerDBResultSet *result_set;
TrackerDBInterface *iface;
@@ -331,14 +287,14 @@
}
gchar *
-tracker_db_file_get_id_as_string (const gchar *service_type,
- const gchar *uri)
+tracker_data_query_file_id_as_string (const gchar *service_type,
+ const gchar *uri)
{
guint32 id;
g_return_val_if_fail (uri != NULL, NULL);
- id = tracker_db_file_get_id (service_type, uri);
+ id = tracker_data_query_file_id (service_type, uri);
if (id > 0) {
return tracker_guint_to_string (id);
@@ -348,11 +304,11 @@
}
gboolean
-tracker_db_check_service (TrackerService *service,
- const gchar *dirname,
- const gchar *basename,
- guint32 *id,
- time_t *mtime)
+tracker_data_query_service_exists (TrackerService *service,
+ const gchar *dirname,
+ const gchar *basename,
+ guint32 *id,
+ time_t *mtime)
{
TrackerDBInterface *iface;
TrackerDBResultSet *result_set;
@@ -397,8 +353,8 @@
}
guint
-tracker_db_get_service_type (const gchar *dirname,
- const gchar *basename)
+tracker_data_query_service_type_id (const gchar *dirname,
+ const gchar *basename)
{
TrackerDBInterface *iface;
TrackerDBResultSet *result_set;
@@ -487,9 +443,8 @@
}
TrackerDataMetadata *
-tracker_db_get_all_metadata (TrackerService *service,
- guint32 service_id,
- gboolean only_embedded)
+tracker_data_query_embedded_metadata (TrackerService *service,
+ guint32 service_id)
{
TrackerDBInterface *iface;
TrackerDBResultSet *result_set = NULL;
@@ -506,19 +461,19 @@
result_set = tracker_db_interface_execute_procedure (iface, NULL, "GetMetadataIDValue", service_id_str, NULL);
if (result_set) {
- result_set_to_metadata (result_set, metadata, FALSE, only_embedded);
+ result_set_to_metadata (result_set, metadata, FALSE, TRUE);
g_object_unref (result_set);
}
result_set = tracker_db_interface_execute_procedure (iface, NULL, "GetMetadataIDValueKeyword", service_id_str, NULL);
if (result_set) {
- result_set_to_metadata (result_set, metadata, FALSE, only_embedded);
+ result_set_to_metadata (result_set, metadata, FALSE, TRUE);
g_object_unref (result_set);
}
result_set = tracker_db_interface_execute_procedure (iface, NULL, "GetMetadataIDValueNumeric", service_id_str, NULL);
if (result_set) {
- result_set_to_metadata (result_set, metadata, TRUE, only_embedded);
+ result_set_to_metadata (result_set, metadata, TRUE, TRUE);
g_object_unref (result_set);
}
@@ -576,23 +531,23 @@
}
gchar *
-tracker_db_get_unparsed_metadata (TrackerService *service,
- guint service_id)
+tracker_data_query_unparsed_metadata (TrackerService *service,
+ guint service_id)
{
return db_get_metadata (service, service_id, TRUE);
}
gchar *
-tracker_db_get_parsed_metadata (TrackerService *service,
- guint service_id)
+tracker_data_query_parsed_metadata (TrackerService *service,
+ guint service_id)
{
return db_get_metadata (service, service_id, FALSE);
}
gchar **
-tracker_db_get_property_values (TrackerService *service_def,
- guint32 id,
- TrackerField *field)
+tracker_data_query_metadata_field_values (TrackerService *service_def,
+ guint32 id,
+ TrackerField *field)
{
TrackerDBInterface *iface;
TrackerDBResultSet *result_set = NULL;
@@ -648,7 +603,7 @@
is_numeric = TRUE;
break;
case TRACKER_FIELD_TYPE_FULLTEXT:
- tracker_db_get_text (service_def, id);
+ tracker_data_query_content (service_def, id);
break;
case TRACKER_FIELD_TYPE_BLOB:
case TRACKER_FIELD_TYPE_STRUCT:
@@ -678,8 +633,8 @@
}
gchar *
-tracker_db_get_text (TrackerService *service,
- guint32 id)
+tracker_data_query_content (TrackerService *service,
+ guint32 id)
{
TrackerDBInterface *iface;
TrackerField *field;
Modified: branches/libtracker-data/src/libtracker-data/tracker-data-query.h
==============================================================================
--- branches/libtracker-data/src/libtracker-data/tracker-data-query.h (original)
+++ branches/libtracker-data/src/libtracker-data/tracker-data-query.h Thu Nov 6 09:45:07 2008
@@ -41,51 +41,47 @@
G_BEGIN_DECLS
/* Metadata API */
-TrackerDBResultSet *tracker_db_metadata_get (TrackerDBInterface *iface,
- const gchar *id,
- const gchar *key);
-GPtrArray * tracker_db_metadata_get_all (const gchar *service_type,
- const gchar *service_id);
-TrackerDBResultSet *tracker_db_metadata_get_array (TrackerDBInterface *iface,
- const gchar *service_type,
- const gchar *service_id,
- gchar **keys);
-gchar * tracker_db_metadata_get_delimited (TrackerDBInterface *iface,
- const gchar *id,
- const gchar *key);
-
-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);
+TrackerDBResultSet *tracker_data_query_metadata_field (TrackerDBInterface *iface,
+ const gchar *service_id,
+ const gchar *field);
+GPtrArray * tracker_data_query_all_metadata (const gchar *service_type,
+ const gchar *service_id);
+TrackerDBResultSet *tracker_data_query_metadata_fields (TrackerDBInterface *iface,
+ const gchar *service_type,
+ const gchar *service_id,
+ gchar **fields);
+
+TrackerDataMetadata *tracker_data_query_embedded_metadata (TrackerService *service,
+ guint32 id);
+gchar * tracker_data_query_parsed_metadata (TrackerService *service,
+ guint32 id);
+gchar * tracker_data_query_unparsed_metadata (TrackerService *service,
+ guint32 id);
+gchar ** tracker_data_query_metadata_field_values (TrackerService *service_def,
+ guint32 id,
+ TrackerField *field_def);
/* 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_data_query_service_exists (TrackerService *service,
+ const gchar *dirname,
+ const gchar *basename,
+ guint32 *id,
+ time_t *mtime);
+guint tracker_data_query_service_type_id (const gchar *dirname,
+ const gchar *basename);
/* Service API */
-gchar * tracker_db_service_get_by_entity (TrackerDBInterface *iface,
- const gchar *id);
+gchar * tracker_data_query_service_type_by_id (TrackerDBInterface *iface,
+ const gchar *id);
/* Files API */
-guint32 tracker_db_file_get_id (const gchar *service_type,
- const gchar *uri);
-gchar * tracker_db_file_get_id_as_string (const gchar *service_type,
- const gchar *uri);
+guint32 tracker_data_query_file_id (const gchar *service_type,
+ const gchar *uri);
+gchar * tracker_data_query_file_id_as_string (const gchar *service_type,
+ const gchar *uri);
-gchar * tracker_db_get_text (TrackerService *service,
- guint32 id);
+gchar * tracker_data_query_content (TrackerService *service,
+ guint32 id);
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 Thu Nov 6 09:45:07 2008
@@ -400,7 +400,7 @@
break;
case TRACKER_FIELD_TYPE_FULLTEXT:
- tracker_data_update_set_contents (service, id, value);
+ tracker_data_update_set_content (service, id, value);
break;
case TRACKER_FIELD_TYPE_BLOB:
@@ -477,7 +477,7 @@
break;
case TRACKER_FIELD_TYPE_FULLTEXT:
- tracker_data_update_delete_contents (service, id);
+ tracker_data_update_delete_content (service, id);
break;
case TRACKER_FIELD_TYPE_BLOB:
@@ -500,7 +500,7 @@
}
void
-tracker_data_update_set_contents (TrackerService *service,
+tracker_data_update_set_content (TrackerService *service,
guint32 id,
const gchar *text)
{
@@ -523,7 +523,7 @@
}
void
-tracker_data_update_delete_contents (TrackerService *service,
+tracker_data_update_delete_content (TrackerService *service,
guint32 id)
{
TrackerDBInterface *iface;
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 Thu Nov 6 09:45:07 2008
@@ -62,10 +62,10 @@
const gchar *value);
/* Contents */
-void tracker_data_update_set_contents (TrackerService *service,
+void tracker_data_update_set_content (TrackerService *service,
guint32 id,
const gchar *text);
-void tracker_data_update_delete_contents (TrackerService *service,
+void tracker_data_update_delete_content (TrackerService *service,
guint32 id);
/* Events */
Modified: branches/libtracker-data/src/libtracker-data/tracker-rdf-query.c
==============================================================================
--- branches/libtracker-data/src/libtracker-data/tracker-rdf-query.c (original)
+++ branches/libtracker-data/src/libtracker-data/tracker-rdf-query.c Thu Nov 6 09:45:07 2008
@@ -1213,7 +1213,7 @@
if (!tracker_is_empty_string (keyword)) {
gchar *keyword_metadata;
- keyword_metadata = tracker_db_metadata_get_related_names (iface,
+ keyword_metadata = tracker_data_query_metadata_field_related_names (iface,
"DC:Keywords");
g_string_append_printf (data.sql_from,
"\n INNER JOIN ServiceKeywordMetaData K ON S.ID = K.ServiceID and K.MetaDataID in (%s) and K.MetaDataValue = '%s' ",
@@ -1338,7 +1338,7 @@
} else {
gchar *related_metadata;
- related_metadata = tracker_db_metadata_get_related_names (iface,
+ related_metadata = tracker_data_query_metadata_field_related_names (iface,
tracker_field_data_get_field_name (l->data));
g_string_append_printf (data.sql_from,
"\n INNER JOIN %s %s ON (S.ID = %s.ServiceID and %s.MetaDataID in (%s)) ",
@@ -1469,7 +1469,7 @@
} else {
gchar *related_metadata;
- related_metadata = tracker_db_metadata_get_related_names (iface,
+ related_metadata = tracker_data_query_metadata_field_related_names (iface,
tracker_field_data_get_field_name (l->data));
g_string_append_printf (data.sql_from,
"\n INNER JOIN %s %s ON (S.ID = %s.ServiceID and %s.MetaDataID in (%s)) ",
Modified: branches/libtracker-data/src/libtracker-data/tracker-xesam-query.c
==============================================================================
--- branches/libtracker-data/src/libtracker-data/tracker-xesam-query.c (original)
+++ branches/libtracker-data/src/libtracker-data/tracker-xesam-query.c Thu Nov 6 09:45:07 2008
@@ -1449,7 +1449,7 @@
} else {
gchar *related_metadata;
- related_metadata = tracker_db_metadata_get_related_names (iface,
+ related_metadata = tracker_data_query_metadata_field_related_names (iface,
tracker_field_data_get_field_name (l->data));
g_string_append_printf (data.sql_join,
" INNER JOIN %s %s ON (S.ID = %s.ServiceID and %s.MetaDataID in (%s)) ",
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 Thu Nov 6 09:45:07 2008
@@ -68,9 +68,11 @@
#include <libtracker-db/tracker-db-index-manager.h>
#include <libtracker-db/tracker-db-interface-sqlite.h>
+#include <libtracker-data/tracker-data-query.h>
+#include <libtracker-data/tracker-data-update.h>
+
#include "tracker-indexer.h"
#include "tracker-indexer-module.h"
-#include <libtracker-data/tracker-data-update.h>
#include "tracker-marshal.h"
#include "tracker-module.h"
@@ -1245,11 +1247,11 @@
/* Remove old text and set new one in the db */
if (old_text) {
- tracker_data_update_delete_contents (service, id);
+ tracker_data_update_delete_content (service, id);
}
if (new_text) {
- tracker_data_update_set_contents (service, id, new_text);
+ tracker_data_update_set_content (service, id, new_text);
}
g_hash_table_unref (old_words);
@@ -1282,7 +1284,7 @@
return;
}
- if (tracker_db_check_service (service, dirname, basename, &id, NULL)) {
+ if (tracker_data_query_service_exists (service, dirname, basename, &id, NULL)) {
TrackerDataMetadata *old_metadata;
gchar *old_text;
gchar *new_text;
@@ -1296,14 +1298,14 @@
* Using DB directly: get old (embedded) metadata,
* unindex, index the new metadata
*/
- old_metadata = tracker_db_get_all_metadata (service, id, TRUE);
+ old_metadata = tracker_data_query_embedded_metadata (service, id);
unindex_metadata (indexer, id, service, old_metadata);
index_metadata (indexer, id, service, metadata);
/* Take the old text -> the new one, calculate
* difference and add the words.
*/
- old_text = tracker_db_get_text (service, id);
+ old_text = tracker_data_query_content (service, id);
new_text = tracker_indexer_module_file_get_text (info->module, info->file);
item_update_content (indexer, service, id, old_text, new_text);
@@ -1343,7 +1345,7 @@
1);
/* Save in the DB */
- tracker_data_update_set_contents (service, id, text);
+ tracker_data_update_set_content (service, id, text);
g_free (text);
}
}
@@ -1378,7 +1380,7 @@
info->other_file->path);
/* Get 'source' ID */
- if (!tracker_db_check_service (service,
+ if (!tracker_data_query_service_exists (service,
dirname,
basename,
&id,
@@ -1396,7 +1398,7 @@
* Using DB directly: get old (embedded) metadata, unindex,
* index the new metadata
*/
- metadata = tracker_db_get_all_metadata (service, id, TRUE);
+ metadata = tracker_data_query_embedded_metadata (service, id);
unindex_metadata (indexer, id, service, metadata);
index_metadata (indexer, id, service, metadata);
}
@@ -1425,7 +1427,7 @@
/* The file is not anymore in the filesystem. Obtain
* the service type from the DB.
*/
- service_type_id = tracker_db_get_service_type (dirname, basename);
+ service_type_id = tracker_data_query_service_type_id (dirname, basename);
if (service_type_id == 0) {
/* File didn't exist, nothing to delete */
@@ -1440,7 +1442,7 @@
service_type_id = tracker_service_get_id (service);
}
- tracker_db_check_service (service, dirname, basename, &service_id, NULL);
+ tracker_data_query_service_exists (service, dirname, basename, &service_id, NULL);
if (service_id < 1) {
g_debug (" File does not exist anyway "
@@ -1450,7 +1452,7 @@
}
/* Get content, unindex the words and delete the contents */
- content = tracker_db_get_text (service, service_id);
+ content = tracker_data_query_content (service, service_id);
if (content) {
unindex_text_with_parsing (indexer,
service_id,
@@ -1458,11 +1460,11 @@
content,
1);
g_free (content);
- tracker_data_update_delete_contents (service, service_id);
+ tracker_data_update_delete_content (service, service_id);
}
/* Get metadata from DB to remove it from the index */
- metadata = tracker_db_get_parsed_metadata (service,
+ metadata = tracker_data_query_parsed_metadata (service,
service_id);
unindex_text_no_parsing (indexer,
service_id,
@@ -1474,7 +1476,7 @@
/* The weight depends on metadata, but a number high enough
* force deletion.
*/
- metadata = tracker_db_get_unparsed_metadata (service,
+ metadata = tracker_data_query_unparsed_metadata (service,
service_id);
unindex_text_with_parsing (indexer,
service_id,
@@ -1565,7 +1567,7 @@
tracker_file_get_path_and_name (uri, &dirname, &basename);
- tracker_db_check_service (service,
+ tracker_data_query_service_exists (service,
dirname,
basename,
&service_id,
@@ -1581,7 +1583,7 @@
return FALSE;
}
- old_contents = tracker_db_get_property_values (service,
+ old_contents = tracker_data_query_metadata_field_values (service,
service_id,
field);
if (!tracker_field_get_multiple_values (field) && old_contents) {
@@ -1700,7 +1702,7 @@
tracker_file_get_path_and_name (uri, &dirname, &basename);
- tracker_db_check_service (service, dirname, basename, &service_id, NULL);
+ tracker_data_query_service_exists (service, dirname, basename, &service_id, NULL);
g_free (dirname);
g_free (basename);
@@ -1728,7 +1730,7 @@
} else {
gchar **old_contents;
- old_contents = tracker_db_get_property_values (service,
+ old_contents = tracker_data_query_metadata_field_values (service,
service_id,
field);
if (old_contents) {
@@ -1792,7 +1794,7 @@
/* Check the file/directory exists. If it doesn't we
* definitely want to index it.
*/
- if (!tracker_db_check_service (service,
+ if (!tracker_data_query_service_exists (service,
dirname,
basename,
NULL,
@@ -1887,7 +1889,7 @@
/* We don't have the mtime for the dirname yet, we do
* if this is a info->file->path of course.
*/
- exists = tracker_db_check_service (service,
+ exists = tracker_data_query_service_exists (service,
parent_dirname,
parent_basename,
NULL,
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 Thu Nov 6 09:45:07 2008
@@ -34,6 +34,7 @@
#include <libtracker-db/tracker-db-manager.h>
#include <libtracker-data/tracker-data-manager.h>
+#include <libtracker-data/tracker-data-query.h>
#include <libtracker-data/tracker-data-search.h>
#include "tracker-dbus.h"
@@ -138,7 +139,7 @@
return;
}
- file_id = tracker_db_file_get_id (TRACKER_DB_FOR_VIRTUAL_SERVICE, uri);
+ file_id = tracker_data_query_file_id (TRACKER_DB_FOR_VIRTUAL_SERVICE, uri);
exists = file_id > 0;
dbus_g_method_return (context, exists);
@@ -228,17 +229,17 @@
static const gchar *
get_file_id_and_db_service (const gchar *uri, gint *id)
{
- *id = tracker_db_file_get_id (TRACKER_DB_FOR_FILE_SERVICE, uri);
+ *id = tracker_data_query_file_id (TRACKER_DB_FOR_FILE_SERVICE, uri);
if (*id) {
return TRACKER_DB_FOR_FILE_SERVICE;
}
- *id = tracker_db_file_get_id (TRACKER_DB_FOR_EMAIL_SERVICE, uri);
+ *id = tracker_data_query_file_id (TRACKER_DB_FOR_EMAIL_SERVICE, uri);
if (*id) {
return TRACKER_DB_FOR_EMAIL_SERVICE;
}
- *id = tracker_db_file_get_id (TRACKER_DB_FOR_VIRTUAL_SERVICE, uri);
+ *id = tracker_data_query_file_id (TRACKER_DB_FOR_VIRTUAL_SERVICE, uri);
if (*id) {
return TRACKER_DB_FOR_VIRTUAL_SERVICE;
}
@@ -288,7 +289,7 @@
iface = tracker_db_manager_get_db_interface_by_service (service_type);
mime = NULL;
- result_set = tracker_db_metadata_get (iface,
+ result_set = tracker_data_query_metadata_field (iface,
file_id_str,
"File:Mime");
@@ -770,7 +771,7 @@
iface = tracker_db_manager_get_db_interface_by_service (TRACKER_DB_FOR_FILE_SERVICE);
/* Get file ID in database */
- file_id = tracker_db_file_get_id (NULL, uri_filtered);
+ file_id = tracker_data_query_file_id (NULL, uri_filtered);
if (file_id == 0) {
g_free (uri_filtered);
tracker_dbus_request_failed (request_id,
@@ -818,7 +819,7 @@
continue;
}
- table = tracker_db_metadata_get_table (tracker_field_get_data_type (defs[i]));
+ table = tracker_data_query_metadata_field_table (tracker_field_get_data_type (defs[i]));
g_string_append_printf (sql,
" LEFT OUTER JOIN %s M%d ON "
Modified: branches/libtracker-data/src/trackerd/tracker-keywords.c
==============================================================================
--- branches/libtracker-data/src/trackerd/tracker-keywords.c (original)
+++ branches/libtracker-data/src/trackerd/tracker-keywords.c Thu Nov 6 09:45:07 2008
@@ -29,9 +29,12 @@
#include <libtracker-db/tracker-db-index.h>
#include <libtracker-db/tracker-db-manager.h>
+#include <libtracker-data/tracker-data-manager.h>
+#include <libtracker-data/tracker-data-query.h>
+#include <libtracker-data/tracker-data-search.h>
+
#include "tracker-dbus.h"
#include "tracker-keywords.h"
-#include <libtracker-data/tracker-data-manager.h>
#include "tracker-marshal.h"
#include "tracker-indexer-client.h"
@@ -201,7 +204,7 @@
return;
}
- id = tracker_db_file_get_id_as_string (service_type, uri);
+ id = tracker_data_query_file_id_as_string (service_type, uri);
if (!id) {
tracker_dbus_request_failed (request_id,
&actual_error,
@@ -213,7 +216,7 @@
}
iface = tracker_db_manager_get_db_interface_by_service (service_type);
- result_set = tracker_db_metadata_get (iface,
+ result_set = tracker_data_query_metadata_field (iface,
id,
"User:Keywords");
values = tracker_dbus_query_result_to_strv (result_set, 0, NULL);
@@ -276,7 +279,7 @@
return;
}
- id = tracker_db_file_get_id_as_string (service_type, uri);
+ id = tracker_data_query_file_id_as_string (service_type, uri);
if (!id) {
tracker_dbus_request_failed (request_id,
&actual_error,
@@ -373,7 +376,7 @@
}
/* Check the uri exists, so we dont start the indexer in vain */
- service_id = tracker_db_file_get_id_as_string (service_type, uri);
+ service_id = tracker_data_query_file_id_as_string (service_type, uri);
if (!service_id) {
tracker_dbus_request_failed (request_id,
&actual_error,
@@ -450,7 +453,7 @@
}
/* Check the uri exists, so we dont start the indexer in vain */
- service_id = tracker_db_file_get_id_as_string (service_type, uri);
+ service_id = tracker_data_query_file_id_as_string (service_type, uri);
if (!service_id) {
tracker_dbus_request_failed (request_id,
&actual_error,
@@ -558,7 +561,7 @@
"' || S.Name as EntityName from Services S, ServiceKeywordMetaData M ");
/* Create where string */
- related_metadata = tracker_db_metadata_get_related_names (iface, "User:Keywords");
+ related_metadata = tracker_data_query_metadata_field_related_names (iface, "User:Keywords");
where = g_string_new ("");
g_string_append_printf (where,
Modified: branches/libtracker-data/src/trackerd/tracker-metadata.c
==============================================================================
--- branches/libtracker-data/src/trackerd/tracker-metadata.c (original)
+++ branches/libtracker-data/src/trackerd/tracker-metadata.c Thu Nov 6 09:45:07 2008
@@ -33,14 +33,15 @@
#include <libtracker-db/tracker-db-index.h>
#include <libtracker-db/tracker-db-manager.h>
+#include <libtracker-data/tracker-data-manager.h>
+#include <libtracker-data/tracker-data-query.h>
+#include <libtracker-data/tracker-rdf-query.h>
+
#include "tracker-indexer-client.h"
#include "tracker-dbus.h"
#include "tracker-metadata.h"
-#include <libtracker-data/tracker-data-manager.h>
#include "tracker-marshal.h"
-#include <libtracker-data/tracker-rdf-query.h>
-
#define DEFAULT_METADATA_MAX_HITS 1024
G_DEFINE_TYPE(TrackerMetadata, tracker_metadata, G_TYPE_OBJECT)
@@ -164,7 +165,7 @@
return;
}
- service_id = tracker_db_file_get_id_as_string (service_type, uri);
+ service_id = tracker_data_query_file_id_as_string (service_type, uri);
if (!service_id) {
tracker_dbus_request_failed (request_id,
&actual_error,
@@ -196,7 +197,7 @@
*/
iface = tracker_db_manager_get_db_interface_by_service (service_type);
- service_result = tracker_db_service_get_by_entity (iface, service_id);
+ service_result = tracker_data_query_service_type_by_id (iface, service_id);
if (!service_result) {
g_free (service_id);
tracker_dbus_request_failed (request_id,
@@ -208,7 +209,7 @@
return;
}
- result_set = tracker_db_metadata_get_array (iface, service_result, service_id, keys);
+ result_set = tracker_data_query_metadata_fields (iface, service_result, service_id, keys);
if (result_set) {
values = tracker_dbus_query_result_columns_to_strv (result_set, -1, -1, TRUE);
g_object_unref (result_set);
@@ -264,7 +265,7 @@
return;
}
- service_id = tracker_db_file_get_id_as_string (service_type, uri);
+ service_id = tracker_data_query_file_id_as_string (service_type, uri);
if (!service_id) {
tracker_dbus_request_failed (request_id,
&actual_error,
@@ -275,7 +276,7 @@
return;
}
- values = tracker_db_metadata_get_all (service_type, service_id);
+ values = tracker_data_query_all_metadata (service_type, service_id);
dbus_g_method_return (context, values);
g_ptr_array_foreach (values, (GFunc)g_strfreev, NULL);
@@ -324,7 +325,7 @@
}
/* Check the uri exists, so we dont start the indexer in vain */
- service_id = tracker_db_file_get_id_as_string (service_type, uri);
+ service_id = tracker_data_query_file_id_as_string (service_type, uri);
if (!service_id) {
tracker_dbus_request_failed (request_id,
&actual_error,
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 Thu Nov 6 09:45:07 2008
@@ -36,6 +36,7 @@
#include <libtracker-db/tracker-db-manager.h>
#include <libtracker-data/tracker-data-manager.h>
+#include <libtracker-data/tracker-data-query.h>
#include <libtracker-data/tracker-data-search.h>
#include <libtracker-data/tracker-query-tree.h>
#include <libtracker-data/tracker-rdf-query.h>
@@ -788,7 +789,7 @@
iface = tracker_db_manager_get_db_interface_by_service (service);
- service_id = tracker_db_file_get_id_as_string (service, id);
+ service_id = tracker_data_query_file_id_as_string (service, id);
if (!service_id) {
g_set_error (&actual_error,
TRACKER_DBUS_ERROR,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]