tracker r1454 - in branches/xesam-support: . src/trackerd
- From: pvanhoof svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1454 - in branches/xesam-support: . src/trackerd
- Date: Tue, 20 May 2008 09:18:21 +0000 (UTC)
Author: pvanhoof
Date: Tue May 20 09:18:21 2008
New Revision: 1454
URL: http://svn.gnome.org/viewvc/tracker?rev=1454&view=rev
Log:
svn merge -r 1448:1453 ../indexer-split
Modified:
branches/xesam-support/ChangeLog
branches/xesam-support/src/trackerd/tracker-db-sqlite.c
branches/xesam-support/src/trackerd/tracker-db-sqlite.h
branches/xesam-support/src/trackerd/tracker-email-kmail.c
branches/xesam-support/src/trackerd/tracker-email-thunderbird.c
branches/xesam-support/src/trackerd/tracker-field.h
branches/xesam-support/src/trackerd/tracker-ontology.h
Modified: branches/xesam-support/src/trackerd/tracker-db-sqlite.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-db-sqlite.c (original)
+++ branches/xesam-support/src/trackerd/tracker-db-sqlite.c Tue May 20 09:18:21 2008
@@ -4034,309 +4034,6 @@
}
TrackerDBResultSet *
-tracker_db_search_text_mime (DBConnection *db_con, const char *text, char **mime_array)
-{
- TrackerQueryTree *tree;
- TrackerDBResultSet *result;
- GArray *hits;
- GSList *result_list;
- guint i;
- int count;
- gint service_array[8];
- GArray *services;
-
- result = NULL;
- result_list = NULL;
-
- service_array[0] = tracker_ontology_get_id_for_service_type ("Files");
- service_array[1] = tracker_ontology_get_id_for_service_type ("Folders");
- service_array[2] = tracker_ontology_get_id_for_service_type ("Documents");
- service_array[3] = tracker_ontology_get_id_for_service_type ("Images");
- service_array[4] = tracker_ontology_get_id_for_service_type ("Music");
- service_array[5] = tracker_ontology_get_id_for_service_type ("Videos");
- service_array[6] = tracker_ontology_get_id_for_service_type ("Text");
- service_array[7] = tracker_ontology_get_id_for_service_type ("Other");
-
- services = g_array_new (TRUE, TRUE, sizeof (gint));
- g_array_append_vals (services, service_array, 8);
-
- tree = tracker_query_tree_new (text,
- db_con->word_index,
- tracker->config,
- tracker->language,
- services);
- hits = tracker_query_tree_get_hits (tree, 0, 0);
- count = 0;
-
- for (i = 0; i < hits->len; i++) {
- TrackerDBResultSet *result_set;
- TrackerSearchHit hit;
- char *str_id, *mimetype;
-
- hit = g_array_index (hits, TrackerSearchHit, i);
-
- str_id = tracker_uint_to_string (hit.service_id);
-
- result_set = tracker_exec_proc (db_con, "GetFileByID", str_id, NULL);
-
- g_free (str_id);
-
- if (result_set) {
- tracker_db_result_set_get (result_set, 2, &mimetype, -1);
-
- if (tracker_string_in_string_list (mimetype, mime_array) != -1) {
- GValue value = { 0, };
-
- if (G_UNLIKELY (!result)) {
- result = _tracker_db_result_set_new (2);
- }
-
- _tracker_db_result_set_append (result);
-
- /* copy value in column 0 */
- _tracker_db_result_set_get_value (result_set, 0, &value);
- _tracker_db_result_set_set_value (result, 0, &value);
- g_value_unset (&value);
-
- /* copy value in column 1 */
- _tracker_db_result_set_get_value (result_set, 1, &value);
- _tracker_db_result_set_set_value (result, 1, &value);
- g_value_unset (&value);
-
- count++;
- }
-
- g_free (mimetype);
- g_object_unref (result_set);
- }
-
- if (count > 2047) {
- break;
- }
- }
-
- g_object_unref (tree);
- g_array_free (hits, TRUE);
- g_array_free (services, TRUE);
-
- if (!result)
- return NULL;
-
- if (tracker_db_result_set_get_n_rows (result) == 0) {
- g_object_unref (result);
- return NULL;
- }
-
- tracker_db_result_set_rewind (result);
-
- return result;
-}
-
-TrackerDBResultSet *
-tracker_db_search_text_location (DBConnection *db_con, const char *text, const char *location)
-{
- TrackerDBResultSet *result;
- TrackerQueryTree *tree;
- GArray *hits;
- char *location_prefix;
- int count;
- gint service_array[8];
- guint i;
- GArray *services;
-
- location_prefix = g_strconcat (location, G_DIR_SEPARATOR_S, NULL);
-
- service_array[0] = tracker_ontology_get_id_for_service_type ("Files");
- service_array[1] = tracker_ontology_get_id_for_service_type ("Folders");
- service_array[2] = tracker_ontology_get_id_for_service_type ("Documents");
- service_array[3] = tracker_ontology_get_id_for_service_type ("Images");
- service_array[4] = tracker_ontology_get_id_for_service_type ("Music");
- service_array[5] = tracker_ontology_get_id_for_service_type ("Videos");
- service_array[6] = tracker_ontology_get_id_for_service_type ("Text");
- service_array[7] = tracker_ontology_get_id_for_service_type ("Other");
-
- services = g_array_new (TRUE, TRUE, sizeof (gint));
- g_array_append_vals (services, service_array, 8);
-
- tree = tracker_query_tree_new (text,
- db_con->word_index,
- tracker->config,
- tracker->language,
- services);
- hits = tracker_query_tree_get_hits (tree, 0, 0);
- count = 0;
-
- for (i = 0; i < hits->len; i++) {
- TrackerDBResultSet *result_set;
- TrackerSearchHit hit;
- char *str_id, *path;
-
- hit = g_array_index (hits, TrackerSearchHit, i);
-
- str_id = tracker_uint_to_string (hit.service_id);
-
- result_set = tracker_exec_proc (db_con, "GetFileByID", str_id, NULL);
-
- g_free (str_id);
-
- if (result_set) {
- tracker_db_result_set_get (result_set, 0, &path, -1);
-
- if (g_str_has_prefix (path, location_prefix) || (strcmp (path, location) == 0)) {
- GValue value = { 0, };
-
- if (G_UNLIKELY (!result)) {
- result = _tracker_db_result_set_new (2);
- }
-
- _tracker_db_result_set_append (result);
-
- /* copy value in column 0 */
- _tracker_db_result_set_get_value (result_set, 0, &value);
- _tracker_db_result_set_set_value (result, 0, &value);
- g_value_unset (&value);
-
- /* copy value in column 1 */
- _tracker_db_result_set_get_value (result_set, 1, &value);
- _tracker_db_result_set_set_value (result, 1, &value);
- g_value_unset (&value);
-
- count++;
- }
-
- g_object_unref (result_set);
- }
-
- if (count > 2047) {
- break;
- }
- }
-
- g_free (location_prefix);
-
- g_object_unref (tree);
- g_array_free (hits, TRUE);
- g_array_free (services, TRUE);
-
- if (!result)
- return NULL;
-
- if (tracker_db_result_set_get_n_rows (result) == 0) {
- g_object_unref (result);
- return NULL;
- }
-
- tracker_db_result_set_rewind (result);
-
- return result;
-}
-
-TrackerDBResultSet *
-tracker_db_search_text_mime_location (DBConnection *db_con, const char *text, char **mime_array, const char *location)
-{
- TrackerDBResultSet *result;
- TrackerQueryTree *tree;
- GArray *hits;
- char *location_prefix;
- int count;
- gint service_array[8];
- guint i;
- GArray *services;
-
- location_prefix = g_strconcat (location, G_DIR_SEPARATOR_S, NULL);
-
- service_array[0] = tracker_ontology_get_id_for_service_type ("Files");
- service_array[1] = tracker_ontology_get_id_for_service_type ("Folders");
- service_array[2] = tracker_ontology_get_id_for_service_type ("Documents");
- service_array[3] = tracker_ontology_get_id_for_service_type ("Images");
- service_array[4] = tracker_ontology_get_id_for_service_type ("Music");
- service_array[5] = tracker_ontology_get_id_for_service_type ("Videos");
- service_array[6] = tracker_ontology_get_id_for_service_type ("Text");
- service_array[7] = tracker_ontology_get_id_for_service_type ("Other");
-
- services = g_array_new (TRUE, TRUE, sizeof (gint));
- g_array_append_vals (services, service_array, 8);
-
- tree = tracker_query_tree_new (text,
- db_con->word_index,
- tracker->config,
- tracker->language,
- services);
- hits = tracker_query_tree_get_hits (tree, 0, 0);
- count = 0;
-
- for (i = 0; i < hits->len; i++) {
- TrackerDBResultSet *result_set;
- TrackerSearchHit hit;
- char *str_id, *path, *mimetype;
-
- hit = g_array_index (hits, TrackerSearchHit, i);
-
- str_id = tracker_uint_to_string (hit.service_id);
-
- result_set = tracker_exec_proc (db_con, "GetFileByID", str_id, NULL);
-
- g_free (str_id);
-
- if (result_set) {
- tracker_db_result_set_get (result_set,
- 0, &path,
- 2, &mimetype,
- -1);
-
- if ((g_str_has_prefix (path, location_prefix) || (strcmp (path, location) == 0)) &&
- tracker_string_in_string_list (mimetype, mime_array) != -1) {
- GValue value = { 0, };
-
- if (G_UNLIKELY (!result)) {
- result = _tracker_db_result_set_new (2);
- }
-
- _tracker_db_result_set_append (result);
-
- /* copy value in column 0 */
- _tracker_db_result_set_get_value (result_set, 0, &value);
- _tracker_db_result_set_set_value (result, 0, &value);
- g_value_unset (&value);
-
- /* copy value in column 1 */
- _tracker_db_result_set_get_value (result_set, 1, &value);
- _tracker_db_result_set_set_value (result, 1, &value);
- g_value_unset (&value);
-
- count++;
- }
-
- g_free (path);
- g_free (mimetype);
- g_object_unref (result_set);
- }
-
- if (count > 2047) {
- break;
- }
- }
-
- g_free (location_prefix);
-
- g_object_unref (tree);
- g_array_free (hits, TRUE);
- g_array_free (services, TRUE);
-
- if (!result)
- return NULL;
-
- if (tracker_db_result_set_get_n_rows (result) == 0) {
- g_object_unref (result);
- return NULL;
- }
-
- tracker_db_result_set_rewind (result);
-
- return result;
-}
-
-TrackerDBResultSet *
tracker_db_get_metadata_types (DBConnection *db_con, const char *class, gboolean writeable)
{
if (strcmp (class, "*") == 0) {
@@ -4896,7 +4593,6 @@
if (result_set) {
gboolean valid = TRUE;
- gchar *name;
gint id;
while (valid) {
@@ -4929,8 +4625,6 @@
tracker_ontology_add_field (def);
- g_free (name);
-
valid = tracker_db_result_set_iter_next (result_set);
}
Modified: branches/xesam-support/src/trackerd/tracker-db-sqlite.h
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-db-sqlite.h (original)
+++ branches/xesam-support/src/trackerd/tracker-db-sqlite.h Tue May 20 09:18:21 2008
@@ -275,16 +275,6 @@
gint offset,
gint limit,
gboolean vfs);
-TrackerDBResultSet *tracker_db_search_text_mime (DBConnection *db_con,
- const gchar *text,
- gchar **mime_array);
-TrackerDBResultSet *tracker_db_search_text_location (DBConnection *db_con,
- const gchar *text,
- const gchar *location);
-TrackerDBResultSet *tracker_db_search_text_mime_location (DBConnection *db_con,
- const gchar *text,
- gchar **mime_array,
- const gchar *location);
TrackerDBResultSet *tracker_db_get_file_subfolders (DBConnection *db_con,
const gchar *uri);
TrackerDBResultSet *tracker_db_get_metadata_types (DBConnection *db_con,
Modified: branches/xesam-support/src/trackerd/tracker-email-kmail.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-email-kmail.c (original)
+++ branches/xesam-support/src/trackerd/tracker-email-kmail.c Tue May 20 09:18:21 2008
@@ -233,7 +233,7 @@
MailStore *store = tracker_db_email_get_mbox_details (db_con, info->uri);
if (!store) {
- tracker_error ("ERROR: could not retrieve store for file %s", info->uri);
+ g_critical ("Could not retrieve store for file:'%s'", info->uri);
return FALSE;
}
@@ -391,7 +391,7 @@
return TRUE;
error:
- tracker_error ("ERROR: file \"%s\" cannot be loaded", m_conf->kmailrc_path);
+ g_critical ("File:'%s' can not be loaded", m_conf->kmailrc_path);
free_kmail_config (*conf);
*conf = NULL;
return FALSE;
@@ -719,17 +719,17 @@
store = tracker_db_email_get_mbox_details (db_con, dir);
if (!store) {
- tracker_error ("ERROR: could not retrieve store for directory %s", dir);
+ g_warning ("Could not retrieve store for directory:'%s'", dir);
return FALSE;
}
- tracker_log ("Looking for email file \"%s\"", info->uri);
+ g_message ("Looking for email file:'%s'", info->uri);
if (!tracker_db_email_is_saved_email_file (db_con, info->uri)) {
MailMessage *mail_msg = email_parse_mail_message_by_path (MAIL_APP_KMAIL, info->uri, NULL, NULL, NULL);
if (!mail_msg) {
- tracker_log ("WARNING: email %s not found", info->uri);
+ g_warning ("Email:'%s' not found", info->uri);
tracker_db_email_free_mail_store (store);
return FALSE;
}
@@ -752,7 +752,7 @@
suffix ":2,S"... For us it just means that trackerd will see a file being deleted and it
will remove it from its database.
*/
- tracker_log ("Nothing need to be done, email file \"%s\" is already up to date", info->uri) ;
+ g_message ("Nothing need to be done, email file:'%s' is already up to date", info->uri) ;
}
tracker_db_email_free_mail_store (store);
Modified: branches/xesam-support/src/trackerd/tracker-email-thunderbird.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-email-thunderbird.c (original)
+++ branches/xesam-support/src/trackerd/tracker-email-thunderbird.c Tue May 20 09:18:21 2008
@@ -131,7 +131,7 @@
tracker_email_watch_emails (DBConnection *db_con)
{
if( thunderbird_mail_dir != NULL ) {
- tracker_log("Thunderbird directory lookup: \"%s\"", thunderbird_mail_dir);
+ g_message ("Thunderbird directory lookup: \"%s\"", thunderbird_mail_dir);
email_watch_directory(thunderbird_mail_dir, "ThunderbirdEmails");
}
}
@@ -146,7 +146,7 @@
if (!thunderbird_file_is_interesting (info))
return FALSE;
- tracker_log ("Thunderbird file index: \"%s\"\n",info->uri);
+ g_message ("Thunderbird file being index:'%s'",info->uri);
if (email_parse_mail_tms_file_and_save_new_emails (db_con, MAIL_APP_THUNDERBIRD, info->uri)) {
unlink(info->uri);
}
@@ -214,7 +214,8 @@
mail_msg->parent_mail_file->path = g_strdup (path);
if (!g_file_get_contents(path, &contents, &length, &error)) {
- tracker_log ("Error reading Thunderbird message summary %s\n", error->message);
+ g_warning ("Could not read Thunderbird message summary, %s",
+ error->message);
g_error_free (error);
return mail_msg;
}
@@ -223,12 +224,12 @@
parser_data, free_parser_data);
if (!g_markup_parse_context_parse(context, contents, length, NULL)) {
- tracker_log ("Error parsing context with length \n");
+ g_warning ("Could not parse markup context with length:%d", length);
goto end;
}
if (!g_markup_parse_context_end_parse(context, NULL)) {
- tracker_log ("Error parsing context \n");
+ g_warning ("Could not parse markup context");
goto end;
}
Modified: branches/xesam-support/src/trackerd/tracker-field.h
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-field.h (original)
+++ branches/xesam-support/src/trackerd/tracker-field.h Tue May 20 09:18:21 2008
@@ -43,8 +43,6 @@
GType tracker_field_type_get_type (void) G_GNUC_CONST;
-
-
#define TRACKER_TYPE_FIELD (tracker_field_get_type ())
#define TRACKER_FIELD(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TRACKER_TYPE_FIELD, TrackerField))
#define TRACKER_FIELD_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TRACKER_TYPE_FIELD, TrackerFieldClass))
@@ -63,47 +61,46 @@
GObjectClass parent_class;
};
-GType tracker_field_get_type (void) G_GNUC_CONST;
+GType tracker_field_get_type (void) G_GNUC_CONST;
TrackerField * tracker_field_new (void);
-const gchar * tracker_field_get_id (const TrackerField *field);
-const gchar * tracker_field_get_name (const TrackerField *field);
-TrackerFieldType tracker_field_get_data_type (const TrackerField *field);
-const gchar * tracker_field_get_field_name (const TrackerField *field);
-gint tracker_field_get_weight (const TrackerField *service);
-gboolean tracker_field_get_embedded (const TrackerField *field);
-gboolean tracker_field_get_multiple_values (const TrackerField *field);
-gboolean tracker_field_get_delimited (const TrackerField *field);
-gboolean tracker_field_get_filtered (const TrackerField *field);
-gboolean tracker_field_get_store_metadata (const TrackerField *field);
-const GSList * tracker_field_get_child_ids (const TrackerField *field);
-
-void tracker_field_set_id (TrackerField *field,
- const gchar *value);
-void tracker_field_set_name (TrackerField *field,
- const gchar *value);
-void tracker_field_set_data_type (TrackerField *field,
- TrackerFieldType value);
-void tracker_field_set_field_name (TrackerField *field,
- const gchar *value);
-void tracker_field_set_weight (TrackerField *field,
- gint value);
-void tracker_field_set_embedded (TrackerField *field,
- gboolean value);
-void tracker_field_set_multiple_values (TrackerField *field,
- gboolean value);
-void tracker_field_set_delimited (TrackerField *field,
- gboolean value);
-void tracker_field_set_filtered (TrackerField *field,
- gboolean value);
-void tracker_field_set_store_metadata (TrackerField *field,
- gboolean value);
-
-void tracker_field_set_child_ids (TrackerField *field,
- const GSList *value);
-void tracker_field_append_child_id (TrackerField *field,
- const gchar *id);
+const gchar * tracker_field_get_id (const TrackerField *field);
+const gchar * tracker_field_get_name (const TrackerField *field);
+TrackerFieldType tracker_field_get_data_type (const TrackerField *field);
+const gchar * tracker_field_get_field_name (const TrackerField *field);
+gint tracker_field_get_weight (const TrackerField *service);
+gboolean tracker_field_get_embedded (const TrackerField *field);
+gboolean tracker_field_get_multiple_values (const TrackerField *field);
+gboolean tracker_field_get_delimited (const TrackerField *field);
+gboolean tracker_field_get_filtered (const TrackerField *field);
+gboolean tracker_field_get_store_metadata (const TrackerField *field);
+const GSList * tracker_field_get_child_ids (const TrackerField *field);
+void tracker_field_set_id (TrackerField *field,
+ const gchar *value);
+
+void tracker_field_set_name (TrackerField *field,
+ const gchar *value);
+void tracker_field_set_data_type (TrackerField *field,
+ TrackerFieldType value);
+void tracker_field_set_field_name (TrackerField *field,
+ const gchar *value);
+void tracker_field_set_weight (TrackerField *field,
+ gint value);
+void tracker_field_set_embedded (TrackerField *field,
+ gboolean value);
+void tracker_field_set_multiple_values (TrackerField *field,
+ gboolean value);
+void tracker_field_set_delimited (TrackerField *field,
+ gboolean value);
+void tracker_field_set_filtered (TrackerField *field,
+ gboolean value);
+void tracker_field_set_store_metadata (TrackerField *field,
+ gboolean value);
+void tracker_field_set_child_ids (TrackerField *field,
+ const GSList *value);
+void tracker_field_append_child_id (TrackerField *field,
+ const gchar *id);
G_END_DECLS
Modified: branches/xesam-support/src/trackerd/tracker-ontology.h
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-ontology.h (original)
+++ branches/xesam-support/src/trackerd/tracker-ontology.h Tue May 20 09:18:21 2008
@@ -19,8 +19,8 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef __TRACKERD_SERVICE_MANAGER_H__
-#define __TRACKERD_SERVICE_MANAGER_H__
+#ifndef __TRACKERD_ONTOLOGY_H__
+#define __TRACKERD_ONTOLOGY_H__
#include <glib-object.h>
@@ -76,9 +76,7 @@
const gchar * tracker_ontology_get_field_id (const gchar *name);
-
-
G_END_DECLS
-#endif /* __TRACKERD_SERVICE_MANAGER_H__ */
+#endif /* __TRACKERD_ONTOLOGY_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]