/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Sylpheed-Claws team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* alfons - all folder item specific settings should migrate into
# include "config.h"
#endif
-#include "intl.h"
+#include <glib.h>
+#include <glib/gi18n.h>
+
#include "defs.h"
#include "folder.h"
#include "utils.h"
#include "prefs_gtk.h"
#include "filtering.h"
-#include "prefs_scoring.h"
#include "folder_item_prefs.h"
FolderItemPrefs tmp_prefs;
NULL, NULL, NULL},
{"sort_descending", "FALSE", &tmp_prefs.sort_descending, P_BOOL,
NULL, NULL, NULL},
- /*{"enable_thread", "TRUE", &tmp_prefs.enable_thread, P_BOOL,
- NULL, NULL, NULL},*/
- {"hide_score", "-9999", &tmp_prefs.kill_score, P_INT,
- NULL, NULL, NULL},
- {"important_score", "1", &tmp_prefs.important_score, P_INT,
- NULL, NULL, NULL},
/* MIGRATION */
{"request_return_receipt", "", &tmp_prefs.request_return_receipt, P_BOOL,
NULL, NULL, NULL},
NULL, NULL, NULL},
{"folder_color", "", &tmp_prefs.color, P_INT,
NULL, NULL, NULL},
+ {"enable_processing", "FALSE", &tmp_prefs.enable_processing, P_BOOL,
+ NULL, NULL, NULL},
+ {"newmailcheck", "TRUE", &tmp_prefs.newmailcheck, P_BOOL,
+ NULL, NULL, NULL},
+ {"offlinesync", "FALSE", &tmp_prefs.offlinesync, P_BOOL,
+ NULL, NULL, NULL},
{NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
};
void folder_item_prefs_read_config(FolderItem * item)
{
gchar * id;
+ gchar *rcpath;
id = folder_item_get_identifier(item);
folder_item_prefs_clear(&tmp_prefs);
- prefs_read_config(param, id, FOLDERITEM_RC);
+ rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, FOLDERITEM_RC, NULL);
+ prefs_read_config(param, id, rcpath, NULL);
g_free(id);
+ g_free(rcpath);
*item->prefs = tmp_prefs;
id = folder_item_get_identifier(item);
- prefs_save_config(param, id, FOLDERITEM_RC);
+ prefs_write_config(param, id, FOLDERITEM_RC);
g_free(id);
/* MIGRATION: make sure migrated items are not saved
prefs->sort_by_subject = FALSE;
prefs->sort_by_score = FALSE;
prefs->sort_descending = FALSE;
- prefs->kill_score = -9999;
- prefs->important_score = 9999;
prefs->request_return_receipt = FALSE;
prefs->enable_default_to = FALSE;
prefs->save_copy_to_folder = FALSE;
prefs->color = 0;
- prefs->scoring = NULL;
+ prefs->enable_processing = TRUE;
prefs->processing = NULL;
+
+ prefs->newmailcheck = TRUE;
+ prefs->offlinesync = FALSE;
+
return prefs;
}
void folder_item_prefs_free(FolderItemPrefs * prefs)
{
- if (prefs->default_to)
- g_free(prefs->default_to);
- if (prefs->default_reply_to)
- g_free(prefs->default_reply_to);
- if (prefs->scoring != NULL)
- prefs_scoring_free(prefs->scoring);
+ g_free(prefs->default_to);
+ g_free(prefs->default_reply_to);
g_free(prefs);
}
void folder_item_prefs_copy_prefs(FolderItem * src, FolderItem * dest)
{
- GSList *tmp_prop_list = NULL, *tmp_scor_list = NULL, *tmp;
+ GSList *tmp_prop_list = NULL, *tmp;
folder_item_prefs_read_config(src);
tmp_prefs.directory = g_strdup(src->prefs->directory);
tmp_prefs.sort_by_score = src->prefs->sort_by_score;
tmp_prefs.sort_descending = src->prefs->sort_descending;
tmp_prefs.enable_thread = src->prefs->enable_thread;
- tmp_prefs.kill_score = src->prefs->kill_score;
- tmp_prefs.important_score = src->prefs->important_score;
+ tmp_prefs.enable_processing = src->prefs->enable_processing;
+ tmp_prefs.newmailcheck = src->prefs->newmailcheck;
+ tmp_prefs.offlinesync = src->prefs->offlinesync;
prefs_matcher_read_config();
- for (tmp = src->prefs->scoring; tmp != NULL && tmp->data != NULL;) {
- ScoringProp *prop = (ScoringProp *)tmp->data;
-
- tmp_scor_list = g_slist_append(tmp_scor_list,
- scoringprop_copy(prop));
- tmp = tmp->next;
- }
- tmp_prefs.scoring = tmp_scor_list;
for (tmp = src->prefs->processing; tmp != NULL && tmp->data != NULL;) {
FilteringProp *prop = (FilteringProp *)tmp->data;
tmp_prefs.enable_default_to = src->prefs->enable_default_to;
tmp_prefs.default_to = g_strdup(src->prefs->default_to);
tmp_prefs.enable_default_reply_to = src->prefs->enable_default_reply_to;
- tmp_prefs.default_reply_to = src->prefs->default_reply_to;
+ tmp_prefs.default_reply_to = g_strdup(src->prefs->default_reply_to);
tmp_prefs.enable_simplify_subject = src->prefs->enable_simplify_subject;
tmp_prefs.simplify_subject_regexp = g_strdup(src->prefs->simplify_subject_regexp);
tmp_prefs.enable_folder_chmod = src->prefs->enable_folder_chmod;