tracker r2471 - in branches/libtracker-data: . src/libtracker-data
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2471 - in branches/libtracker-data: . src/libtracker-data
- Date: Thu, 6 Nov 2008 13:43:45 +0000 (UTC)
Author: juergbi
Date: Thu Nov 6 13:43:44 2008
New Revision: 2471
URL: http://svn.gnome.org/viewvc/tracker?rev=2471&view=rev
Log:
2008-11-06 JÃrg Billeter <j bitron ch>
* src/libtracker-data/tracker-data-query.c:
* src/libtracker-data/tracker-data-query.h:
* src/libtracker-data/tracker-data-search.c:
* src/libtracker-data/tracker-data-search.h:
* src/libtracker-data/tracker-data-update.c:
* src/libtracker-data/tracker-data-update.h:
Use more consistent parameter names
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.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-search.c
branches/libtracker-data/src/libtracker-data/tracker-data-search.h
branches/libtracker-data/src/libtracker-data/tracker-data-update.c
branches/libtracker-data/src/libtracker-data/tracker-data-update.h
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 13:43:44 2008
@@ -73,10 +73,10 @@
void
-tracker_data_manager_init (TrackerConfig *config,
- TrackerLanguage *language,
- TrackerDBIndex *file_index,
- TrackerDBIndex *email_index)
+tracker_data_manager_init (TrackerConfig *config,
+ TrackerLanguage *language,
+ TrackerDBIndex *file_index,
+ TrackerDBIndex *email_index)
{
TrackerDBPrivate *private;
@@ -141,8 +141,8 @@
gboolean
tracker_data_manager_exec_no_reply (TrackerDBInterface *iface,
- const gchar *query,
- ...)
+ const gchar *query,
+ ...)
{
TrackerDBResultSet *result_set;
va_list args;
@@ -167,8 +167,8 @@
TrackerDBResultSet *
tracker_data_manager_exec (TrackerDBInterface *iface,
- const gchar *query,
- ...)
+ const gchar *query,
+ ...)
{
TrackerDBResultSet *result_set;
va_list args;
@@ -192,8 +192,8 @@
TrackerDBResultSet *
tracker_data_manager_exec_proc (TrackerDBInterface *iface,
- const gchar *procedure,
- ...)
+ const gchar *procedure,
+ ...)
{
TrackerDBResultSet *result_set;
va_list args;
@@ -248,7 +248,7 @@
void
tracker_data_manager_set_db_option_int (const gchar *option,
- gint value)
+ gint value)
{
TrackerDBInterface *iface;
TrackerDBResultSet *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 Thu Nov 6 13:43:44 2008
@@ -42,22 +42,22 @@
TrackerLanguage *language,
TrackerDBIndex *file_index,
TrackerDBIndex *email_index);
-void tracker_data_manager_shutdown (void);
+void tracker_data_manager_shutdown (void);
TrackerConfig * tracker_data_manager_get_config (void);
TrackerLanguage * tracker_data_manager_get_language (void);
/* Operations for TrackerDBInterface */
-TrackerDBResultSet *tracker_data_manager_exec_proc (TrackerDBInterface *iface,
+TrackerDBResultSet *tracker_data_manager_exec_proc (TrackerDBInterface *iface,
const gchar *procedure,
...);
-gboolean tracker_data_manager_exec_no_reply (TrackerDBInterface *iface,
+gboolean tracker_data_manager_exec_no_reply (TrackerDBInterface *iface,
const gchar *query,
...);
-TrackerDBResultSet *tracker_data_manager_exec (TrackerDBInterface *iface,
+TrackerDBResultSet *tracker_data_manager_exec (TrackerDBInterface *iface,
const char *query,
...);
-gint tracker_data_manager_get_db_option_int (const gchar *option);
-void tracker_data_manager_set_db_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);
G_END_DECLS
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 Thu Nov 6 13:43:44 2008
@@ -31,24 +31,24 @@
gpointer value,
gpointer user_data);
-TrackerDataMetadata * tracker_data_metadata_new (void);
-void tracker_data_metadata_free (TrackerDataMetadata *metadata);
+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);
+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-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 13:43:44 2008
@@ -45,19 +45,19 @@
TrackerDBResultSet *
tracker_data_query_metadata_field (TrackerDBInterface *iface,
const gchar *id,
- const gchar *key)
+ const gchar *field)
{
TrackerField *def;
const gchar *proc = NULL;
g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
g_return_val_if_fail (id, NULL);
- g_return_val_if_fail (key, NULL);
+ g_return_val_if_fail (field, NULL);
- def = tracker_ontology_get_field_by_name (key);
+ def = tracker_ontology_get_field_by_name (field);
if (!def) {
- g_warning ("Metadata not found for id:'%s' and type:'%s'", id, key);
+ g_warning ("Metadata not found for id:'%s' and type:'%s'", id, field);
return NULL;
}
@@ -153,7 +153,7 @@
tracker_data_query_metadata_fields (TrackerDBInterface *iface,
const gchar *service_type,
const gchar *service_id,
- gchar **keys)
+ gchar **fields)
{
TrackerDBResultSet *result_set;
GString *sql, *sql_join;
@@ -164,12 +164,12 @@
sql = g_string_new (" SELECT DISTINCT ");
sql_join = g_string_new (" FROM Services S ");
- for (i = 0; i < g_strv_length (keys); i++) {
+ for (i = 0; i < g_strv_length (fields); i++) {
TrackerFieldData *field_data;
field_data = tracker_data_schema_get_metadata_field (iface,
service_type,
- keys[i],
+ fields[i],
i,
TRUE,
FALSE);
@@ -224,18 +224,18 @@
*/
gchar *
tracker_data_query_service_type_by_id (TrackerDBInterface *iface,
- const gchar *id)
+ const gchar *service_id)
{
TrackerDBResultSet *result_set;
gint service_type_id;
gchar *result = 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 (service_id != NULL, NULL);
result_set = tracker_data_manager_exec_proc (iface,
"GetFileByID",
- id,
+ service_id,
NULL);
if (result_set) {
@@ -251,14 +251,14 @@
guint32
tracker_data_query_file_id (const gchar *service_type,
- const gchar *uri)
+ const gchar *path)
{
TrackerDBResultSet *result_set;
TrackerDBInterface *iface;
- gchar *path, *name;
+ gchar *dir, *name;
guint32 id = 0;
- g_return_val_if_fail (uri != NULL, 0);
+ g_return_val_if_fail (path != NULL, 0);
iface = tracker_db_manager_get_db_interface_by_service (service_type);
@@ -268,15 +268,15 @@
return 0;
}
- tracker_file_get_path_and_name (uri, &path, &name);
+ tracker_file_get_path_and_name (path, &dir, &name);
result_set = tracker_data_manager_exec_proc (iface,
"GetServiceID",
- path,
+ dir,
name,
NULL);
- g_free (path);
+ g_free (dir);
g_free (name);
if (result_set) {
@@ -289,13 +289,13 @@
gchar *
tracker_data_query_file_id_as_string (const gchar *service_type,
- const gchar *uri)
+ const gchar *path)
{
guint32 id;
- g_return_val_if_fail (uri != NULL, NULL);
+ g_return_val_if_fail (path != NULL, NULL);
- id = tracker_data_query_file_id (service_type, uri);
+ id = tracker_data_query_file_id (service_type, path);
if (id > 0) {
return tracker_guint_to_string (id);
@@ -308,7 +308,7 @@
tracker_data_query_service_exists (TrackerService *service,
const gchar *dirname,
const gchar *basename,
- guint32 *id,
+ guint32 *service_id,
time_t *mtime)
{
TrackerDBInterface *iface;
@@ -342,8 +342,8 @@
}
}
- if (id) {
- *id = (guint32) db_id;
+ if (service_id) {
+ *service_id = (guint32) db_id;
}
if (mtime) {
@@ -547,7 +547,7 @@
gchar **
tracker_data_query_metadata_field_values (TrackerService *service_def,
- guint32 id,
+ guint32 service_id,
TrackerField *field)
{
TrackerDBInterface *iface;
@@ -566,7 +566,7 @@
query = g_strdup_printf ("SELECT KeyMetadata%d FROM Services WHERE id = '%d'",
metadata_key,
- id);
+ service_id);
result_set = tracker_db_interface_execute_query (iface,
NULL,
query,
@@ -575,7 +575,7 @@
} else {
gchar *id_str;
- id_str = tracker_guint32_to_string (id);
+ id_str = tracker_guint32_to_string (service_id);
switch (tracker_field_get_data_type (field)) {
case TRACKER_FIELD_TYPE_KEYWORD:
@@ -604,7 +604,7 @@
is_numeric = TRUE;
break;
case TRACKER_FIELD_TYPE_FULLTEXT:
- tracker_data_query_content (service_def, id);
+ tracker_data_query_content (service_def, service_id);
break;
case TRACKER_FIELD_TYPE_BLOB:
case TRACKER_FIELD_TYPE_STRUCT:
@@ -635,14 +635,14 @@
gchar *
tracker_data_query_content (TrackerService *service,
- guint32 id)
+ guint32 service_id)
{
TrackerDBInterface *iface;
TrackerField *field;
gchar *service_id_str, *contents = NULL;
TrackerDBResultSet *result_set;
- service_id_str = tracker_guint32_to_string (id);
+ service_id_str = tracker_guint32_to_string (service_id);
field = tracker_ontology_get_field_by_name ("File:Contents");
iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
TRACKER_DB_CONTENT_TYPE_CONTENTS);
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 13:43:44 2008
@@ -52,36 +52,36 @@
gchar **fields);
TrackerDataMetadata *tracker_data_query_embedded_metadata (TrackerService *service,
- guint32 id);
+ guint32 service_id);
gchar * tracker_data_query_parsed_metadata (TrackerService *service,
- guint32 id);
+ guint32 service_id);
gchar * tracker_data_query_unparsed_metadata (TrackerService *service,
- guint32 id);
+ guint32 service_id);
gchar ** tracker_data_query_metadata_field_values (TrackerService *service_def,
- guint32 id,
+ guint32 service_id,
TrackerField *field_def);
/* Using path */
gboolean tracker_data_query_service_exists (TrackerService *service,
const gchar *dirname,
const gchar *basename,
- guint32 *id,
+ guint32 *service_id,
time_t *mtime);
guint tracker_data_query_service_type_id (const gchar *dirname,
const gchar *basename);
/* Service API */
gchar * tracker_data_query_service_type_by_id (TrackerDBInterface *iface,
- const gchar *id);
+ const gchar *service_id);
/* Files API */
guint32 tracker_data_query_file_id (const gchar *service_type,
- const gchar *uri);
+ const gchar *path);
gchar * tracker_data_query_file_id_as_string (const gchar *service_type,
- const gchar *uri);
+ const gchar *path);
gchar * tracker_data_query_content (TrackerService *service,
- guint32 id);
+ guint32 service_id);
G_END_DECLS
Modified: branches/libtracker-data/src/libtracker-data/tracker-data-search.c
==============================================================================
--- branches/libtracker-data/src/libtracker-data/tracker-data-search.c (original)
+++ branches/libtracker-data/src/libtracker-data/tracker-data-search.c Thu Nov 6 13:43:44 2008
@@ -494,17 +494,17 @@
gchar **
tracker_data_search_files_get (TrackerDBInterface *iface,
- const gchar *uri)
+ const gchar *folder_path)
{
TrackerDBResultSet *result_set;
GPtrArray *array;
g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
- g_return_val_if_fail (uri != NULL, NULL);
+ g_return_val_if_fail (folder_path != NULL, NULL);
result_set = tracker_data_manager_exec_proc (iface,
"SelectFileChild",
- uri,
+ folder_path,
NULL);
array = g_ptr_array_new ();
Modified: branches/libtracker-data/src/libtracker-data/tracker-data-search.h
==============================================================================
--- branches/libtracker-data/src/libtracker-data/tracker-data-search.h (original)
+++ branches/libtracker-data/src/libtracker-data/tracker-data-search.h Thu Nov 6 13:43:44 2008
@@ -58,7 +58,7 @@
/* Files API */
gchar ** tracker_data_search_files_get (TrackerDBInterface *iface,
- const gchar *folder_uri);
+ const gchar *folder_path);
TrackerDBResultSet *tracker_data_search_files_get_by_service (TrackerDBInterface *iface,
const gchar *service,
gint offset,
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 13:43:44 2008
@@ -145,7 +145,7 @@
gboolean
tracker_data_update_create_service (TrackerService *service,
- guint32 id,
+ guint32 service_id,
const gchar *dirname,
const gchar *basename,
TrackerDataMetadata *metadata)
@@ -161,7 +161,7 @@
iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
TRACKER_DB_CONTENT_TYPE_METADATA);
- id_str = tracker_guint32_to_string (id);
+ id_str = tracker_guint32_to_string (service_id);
service_type_id_str = tracker_gint_to_string (tracker_service_get_id (service));
path = g_build_filename (dirname, basename, NULL);
@@ -191,7 +191,7 @@
if (!enabled) {
tracker_db_interface_execute_query (iface, NULL,
"Update services set Enabled = 0 where ID = %d",
- id);
+ service_id);
}
g_free (id_str);
@@ -340,17 +340,17 @@
void
tracker_data_update_set_metadata (TrackerService *service,
- guint32 id,
- TrackerField *field,
- const gchar *value,
- const gchar *parsed_value)
+ guint32 service_id,
+ TrackerField *field,
+ const gchar *value,
+ const gchar *parsed_value)
{
TrackerDBInterface *iface;
gint metadata_key;
gchar *id_str;
gchar *time_string;
- id_str = tracker_guint32_to_string (id);
+ id_str = tracker_guint32_to_string (service_id);
iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
TRACKER_DB_CONTENT_TYPE_METADATA);
@@ -401,7 +401,7 @@
break;
case TRACKER_FIELD_TYPE_FULLTEXT:
- tracker_data_update_set_content (service, id, value);
+ tracker_data_update_set_content (service, service_id, value);
break;
case TRACKER_FIELD_TYPE_BLOB:
@@ -419,7 +419,7 @@
"update Services set KeyMetadata%d = '%s' where id = %d",
metadata_key,
value,
- id);
+ service_id);
}
g_free (id_str);
@@ -427,7 +427,7 @@
void
tracker_data_update_delete_metadata (TrackerService *service,
- guint32 id,
+ guint32 service_id,
TrackerField *field,
const gchar *value)
{
@@ -435,7 +435,7 @@
gint metadata_key;
gchar *id_str;
- id_str = tracker_guint32_to_string (id);
+ id_str = tracker_guint32_to_string (service_id);
iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
TRACKER_DB_CONTENT_TYPE_METADATA);
@@ -478,7 +478,7 @@
break;
case TRACKER_FIELD_TYPE_FULLTEXT:
- tracker_data_update_delete_content (service, id);
+ tracker_data_update_delete_content (service, service_id);
break;
case TRACKER_FIELD_TYPE_BLOB:
@@ -494,7 +494,7 @@
if (metadata_key > 0) {
tracker_db_interface_execute_query (iface, NULL,
"update Services set KeyMetadata%d = '%s' where id = %d",
- metadata_key, "", id);
+ metadata_key, "", service_id);
}
g_free (id_str);
@@ -502,14 +502,14 @@
void
tracker_data_update_set_content (TrackerService *service,
- guint32 id,
- const gchar *text)
+ guint32 service_id,
+ const gchar *text)
{
TrackerDBInterface *iface;
TrackerField *field;
gchar *id_str;
- id_str = tracker_guint32_to_string (id);
+ id_str = tracker_guint32_to_string (service_id);
field = tracker_ontology_get_field_by_name ("File:Contents");
iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
TRACKER_DB_CONTENT_TYPE_CONTENTS);
@@ -525,13 +525,13 @@
void
tracker_data_update_delete_content (TrackerService *service,
- guint32 id)
+ guint32 service_id)
{
TrackerDBInterface *iface;
TrackerField *field;
gchar *service_id_str;
- service_id_str = tracker_guint32_to_string (id);
+ service_id_str = tracker_guint32_to_string (service_id);
field = tracker_ontology_get_field_by_name ("File:Contents");
iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
TRACKER_DB_CONTENT_TYPE_CONTENTS);
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 13:43:44 2008
@@ -36,12 +36,12 @@
/* Services */
gboolean tracker_data_update_create_service (TrackerService *service,
- guint32 id,
+ guint32 service_id,
const gchar *dirname,
const gchar *basename,
TrackerDataMetadata *metadata);
void tracker_data_update_delete_service (TrackerService *service,
- guint32 id);
+ guint32 service_id);
void tracker_data_update_delete_service_recursively (TrackerService *service,
gchar *service_path);
void tracker_data_update_move_service (TrackerService *service,
@@ -50,23 +50,23 @@
/* Metadata */
void tracker_data_update_set_metadata (TrackerService *service,
- guint32 id,
+ guint32 service_id,
TrackerField *field,
const gchar *value,
const gchar *parsed_value);
void tracker_data_update_delete_all_metadata (TrackerService *service,
- guint32 id);
+ guint32 service_id);
void tracker_data_update_delete_metadata (TrackerService *service,
- guint32 id,
+ guint32 service_id,
TrackerField *field,
const gchar *value);
/* Contents */
void tracker_data_update_set_content (TrackerService *service,
- guint32 id,
+ guint32 service_id,
const gchar *text);
void tracker_data_update_delete_content (TrackerService *service,
- guint32 id);
+ guint32 service_id);
/* Events */
void tracker_data_update_create_event (TrackerDBInterface *iface,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]