Commit aa30c2f5 authored by Jamie McCracken's avatar Jamie McCracken

fixes for releaseing file handles for email stuff

svn path=/trunk/; revision=481
parent d10abba5
......@@ -116,34 +116,18 @@ tracker_db_email_get_last_mbox_offset (DBConnection *db_con, const char *mbox_fi
guint
tracker_db_email_get_nb_emails_in_mbox (DBConnection *db_con, const char *mbox_file_path)
{
char ***res;void
tracker_db_email_update_nb_emails_in_dir (DBConnection *db_con, const char *dir_path, int count)
{
g_return_if_fail (db_con);
g_return_if_fail (dir_path);
/* make sure dir_path is registered in DB before doing an update */
if (get_mbox_offset (db_con, dir_path) != -1) {
char *str_offset;
str_offset = tracker_uint_to_str (count);
tracker_exec_proc (db_con, "UpdateMboxDetails", 6, str_offset, "n/a", "0", "0", "0", dir_path);
tracker_debug ("updated no. of emails in %s to %s", dir_path, str_offset);
char ***res;
g_free (str_offset);
} else {
tracker_log ("Error: invalid dir_path \"%s\"", dir_path);
}
}
char **row;
int count;
g_return_val_if_fail (db_con, 0);
g_return_val_if_fail (mbox_file_path, 0);
/* res = tracker_exec_proc (db_con, "GetMboxCount", 1, mbox_file_path);
if (!res) {
......
......@@ -2326,6 +2326,8 @@ generate_display_metadata (DBConnection *db_con, const char *id, const char *me
k++;
}
tracker_db_free_result (res);
}
......
......@@ -241,9 +241,7 @@ tracker_db_add_embedded_keywords (DBConnection *db_con, const char *file_id, con
tag = g_strstrip (tag);
if (strlen (tag) > 0) {
if (tracker->verbosity > 0) {
tracker_log ("Auto-tagging file with %s", tag);
}
tracker_info ("Auto-tagging file with %s", tag);
}
if (is_new) {
......@@ -797,12 +795,10 @@ tracker_db_index_service (DBConnection *db_con, FileInfo *info, const char *serv
return;
}
if (tracker->verbosity > 0) {
if (info->is_new) {
tracker_log ("Indexing %s with service %s and mime %s (new)", info->uri, service, info->mime);
} else {
tracker_log ("Indexing %s with service %s and mime %s (existing)", info->uri, service, info->mime);
}
if (info->is_new) {
tracker_info ("Indexing %s with service %s and mime %s (new)", info->uri, service, info->mime);
} else {
tracker_info ("Indexing %s with service %s and mime %s (existing)", info->uri, service, info->mime);
}
str_file_id = tracker_uint_to_str (info->file_id);
......
......@@ -1288,7 +1288,6 @@ make_uri (const char *account_name, const char *path, const char *uid)
these must be converted to "email://local@local/Inbox/Others;uid=46" IE with the folder extension ".sbd" cut off
*/
mail_path = g_strdup (path);
mail_path = tracker_string_replace (path, ".sbd", NULL);
uri = g_strdup_printf ("email://%s/%s;uid=%s", account_name, mail_path, uid);
......
......@@ -306,6 +306,7 @@ email_open_mail_file_at_offset (MailApplication mail_app, const char *path, off_
mf->path = g_strdup (path);
mf->mail_app = mail_app;
mf->parser = parser;
mf->stream = stream;
mf->next_email_offset = offset;
return mf;
......@@ -323,6 +324,8 @@ email_free_mail_file (MailFile *mf)
g_free (mf->path);
}
g_mime_stream_close (mf->stream);
g_object_unref (mf->parser);
g_free (mf);
......
......@@ -44,6 +44,7 @@ typedef struct {
char *path;
MailApplication mail_app;
GMimeParser *parser;
GMimeStream *stream;
guint64 next_email_offset;
} MailFile;
......
......@@ -1889,7 +1889,7 @@ tracker_set_language (const char *language, gboolean create_stemmer)
if (!tracker->stemmer) {
tracker_log ("Warning : No stemmer could be found for language %s", language);
} else {
tracker_log ("Using stemmer for language %s", language);
tracker_log ("Using stemmer for language %s\n", language);
}
}
......@@ -1922,9 +1922,9 @@ tracker_load_config_file ()
contents = g_strconcat (
"[General]\n",
"# Set to true to enable more verbose logging in the log file (setting to false will make indexing faster)\n",
"EnableDebugLogging=false\n\n",
"# Poll Interval in seconds - determines how often polling is performed when intoify/fam is not available or watch limit is exceeded\n",
"# Log Verbosity - Valid values are 0 (default, fastest), 1 (detailed), & 2 (debug)\n",
"Verbosity=0\n\n",
"# Poll Interval in seconds - determines how often polling is performed when inotify/fam is not available or watch limit is exceeded\n",
"PollInterval=3600\n\n",
"[Watches]\n",
"# List of directory roots to index and watch seperated by semicolons\n",
......@@ -1951,13 +1951,13 @@ tracker_load_config_file ()
"# Sets the language specific stemmer and stopword list to use \n",
"# Valid values are 'en' (english), 'da' (danish), 'nl' (dutch), 'fi' (finnish), 'fr' (french), 'de' (german), 'it' (italien), 'nb' (norwegian), 'pt' (portugese), 'ru' (russian), 'es' (spanish), 'sv' (swedish)\n",
"Language=", language, "\n",
"# Enables use of language specific stemmer\n",
"# Enables use of language-specific stemmer\n",
"EnableStemmer=true\n",
"# Sets whether to use the slower pango word break algortihm (only set this for CJK languages which dont contain western styke word breaks)\n",
"EnablePangoWordBreaks=", enable_pango, "\n\n",
"[Services]\n",
"IndexEvolutionEmails=true\n",
"IndexThunderbirdEmails=tru\n",
"IndexThunderbirdEmails=true\n",
"IndexKmailEmails=true\n\n",
"[Emails]\n",
"AdditionalMBoxesToIndex=;\n\n",
......@@ -1987,6 +1987,10 @@ tracker_load_config_file ()
/* general options */
if (g_key_file_has_key (key_file, "General", "Verbosity", NULL)) {
tracker->verbosity = g_key_file_get_integer (key_file, "General", "Verbosity", NULL);
}
if (g_key_file_has_key (key_file, "General", "PollInterval", NULL)) {
tracker->poll_interval = g_key_file_get_integer (key_file, "General", "PollInterval", NULL);
......
......@@ -1094,9 +1094,9 @@ process_files_thread (void)
pushed_events = TRUE;
}
if (tracker->is_running) {
tracker_db_free_result (res);
}
tracker_db_free_result (res);
}
if (!tracker->is_running) {
......@@ -1850,22 +1850,24 @@ sanity_check_option_values ()
char *bools[] = {"no", "yes"};
tracker_log ("\nTracker configuration options :");
tracker_log ("Low memory mode : \t\t\t%s", bools[!tracker->use_extra_memory]);
tracker_log ("Indexing enabled : \t\t\t%s", bools[tracker->enable_indexing]);
tracker_log ("Watching enabled : \t\t\t%s", bools[tracker->enable_watching]);
tracker_log ("File content indexing enabled : \t%s", bools[tracker->enable_content_indexing]);
tracker_log ("Thumbnailing enabled : \t\t\t%s", bools[tracker->enable_thumbnails]);
tracker_log ("Evolution email indexing enabled : \t%s", bools[tracker->index_evolution_emails]);
tracker_log ("Thunderbird email indexing enabled : \t%s", bools[tracker->index_thunderbird_emails]);
tracker_log ("K-Mail indexing enabled : \t\t%s\n", bools[tracker->index_kmail_emails]);
tracker_log ("Tracker configuration options :");
tracker_log ("Verbosity : ........................ %d", tracker->verbosity);
tracker_log ("Low memory mode : .................. %s", bools[!tracker->use_extra_memory]);
tracker_log ("Indexing enabled : ................. %s", bools[tracker->enable_indexing]);
tracker_log ("Watching enabled : ................. %s", bools[tracker->enable_watching]);
tracker_log ("File content indexing enabled : .... %s", bools[tracker->enable_content_indexing]);
tracker_log ("Thumbnailing enabled : ............. %s", bools[tracker->enable_thumbnails]);
tracker_log ("Thumbnailing enabled : ............. %s", bools[tracker->enable_thumbnails]);
tracker_log ("Evolution email indexing enabled : . %s", bools[tracker->index_evolution_emails]);
tracker_log ("Thunderbird email indexing enabled : %s", bools[tracker->index_thunderbird_emails]);
tracker_log ("K-Mail indexing enabled : .......... %s\n", bools[tracker->index_kmail_emails]);
tracker_log ("Tracker indexer parameters :");
tracker_log ("Indexer language code : \t\t%s", tracker->language);
tracker_log ("Minimum index word length : \t\t%d", tracker->min_word_length);
tracker_log ("Maximum index word length : \t\t%d", tracker->max_word_length);
tracker_log ("Stemmer enabled : \t\t\t%s", bools[tracker->use_stemmer]);
tracker_log ("Using Pango word breaking : \t\t%s\n\n", bools[tracker->use_pango_word_break]);
tracker_log ("Indexer language code : ............ %s", tracker->language);
tracker_log ("Minimum index word length : ........ %d", tracker->min_word_length);
tracker_log ("Maximum index word length : ........ %d", tracker->max_word_length);
tracker_log ("Stemmer enabled : .................. %s", bools[tracker->use_stemmer]);
tracker_log ("Using Pango word breaking : ........ %s\n\n", bools[tracker->use_pango_word_break]);
tracker->word_count = 0;
tracker->word_detail_count = 0;
......@@ -2150,7 +2152,7 @@ main (int argc, char **argv)
tracker->use_extra_memory = FALSE;
}
tracker->verbosity = verbosity;
//tracker->verbosity = verbosity;
sanity_check_option_values ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment