tracker r2770 - in trunk: . src/tracker-indexer/modules
- From: carlosg svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2770 - in trunk: . src/tracker-indexer/modules
- Date: Wed, 7 Jan 2009 15:53:16 +0000 (UTC)
Author: carlosg
Date: Wed Jan 7 15:53:15 2009
New Revision: 2770
URL: http://svn.gnome.org/viewvc/tracker?rev=2770&view=rev
Log:
2009-01-07 Carlos Garnacho <carlos imendio com>
Several improvements to the evolution module.
* src/tracker-indexer/modules/evolution-imap-db.c
(tracker_evolution_imap_db_file_initialize): Do not try to extract
data from a busy database.
(extract_message_text): Handle g_convert() failures gracefully.
(get_message_metadata): Do not try to index the email if it doesn't
contain the essential information.
(tracker_evolution_imap_db_file_iter_contents): Make cur_message_uid
actuallly point to the current message.
* src/tracker-indexer/modules/evolution-imap.c (get_message_metadata):
Do not try to index the email if it doesn't contain the essential
information.
Modified:
trunk/ChangeLog
trunk/src/tracker-indexer/modules/evolution-imap-db.c
trunk/src/tracker-indexer/modules/evolution-imap.c
Modified: trunk/src/tracker-indexer/modules/evolution-imap-db.c
==============================================================================
--- trunk/src/tracker-indexer/modules/evolution-imap-db.c (original)
+++ trunk/src/tracker-indexer/modules/evolution-imap-db.c Wed Jan 7 15:53:15 2009
@@ -354,7 +354,7 @@
do {
result = sqlite3_step (stmt);
- if (result != SQLITE_DONE) {
+ if (result == SQLITE_ROW) {
const gchar *folder;
folder = sqlite3_column_text (stmt, 0);
@@ -648,9 +648,12 @@
g_string_append_len (body, content, (gssize) len);
} else {
part_body = g_convert (content, (gssize) len, "utf8", encoding, NULL, NULL, NULL);
- g_string_append (body, part_body);
- g_free (part_body);
+ if (part_body) {
+ g_string_append (body, part_body);
+ g_free (part_body);
+ }
+
g_free (encoding);
}
}
@@ -744,7 +747,7 @@
to = g_strdup ((const gchar *) sqlite3_column_text (self->stmt, 6));
cc = g_strdup ((const gchar *) sqlite3_column_text (self->stmt, 7));
- if (!deleted) {
+ if (!deleted && subject && from) {
metadata = tracker_module_metadata_new ();
tracker_module_metadata_add_string (metadata, METADATA_EMAIL_DATE, date);
@@ -895,8 +898,8 @@
/* Iterate through messages, if any */
if (self->cur_message < self->n_messages) {
- self->cur_message_uid = g_strdup ((const gchar *) sqlite3_column_text (self->stmt, 0));
sqlite3_step (self->stmt);
+ self->cur_message_uid = g_strdup ((const gchar *) sqlite3_column_text (self->stmt, 0));
return TRUE;
}
Modified: trunk/src/tracker-indexer/modules/evolution-imap.c
==============================================================================
--- trunk/src/tracker-indexer/modules/evolution-imap.c (original)
+++ trunk/src/tracker-indexer/modules/evolution-imap.c Wed Jan 7 15:53:15 2009
@@ -914,7 +914,7 @@
return NULL;
}
- if (!deleted) {
+ if (!deleted && subject && from) {
metadata = tracker_module_metadata_new ();
tracker_module_metadata_add_date (metadata, METADATA_EMAIL_DATE, t);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]