aboutsummaryrefslogtreecommitdiff
path: root/src/prefs_filter.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-01-17 11:14:06 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-01-17 11:14:06 +0000
commit3fec59fac205ff4588f8afe93b28943b31f9ab8d (patch)
tree0687e8a4cc948efdbcf2a480beb9381a03382e85 /src/prefs_filter.c
parentf0325b36e30c81266a5e6f750553be6bc6e8fe33 (diff)
automatically take over older config files.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@13 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/prefs_filter.c')
-rw-r--r--src/prefs_filter.c43
1 files changed, 7 insertions, 36 deletions
diff --git a/src/prefs_filter.c b/src/prefs_filter.c
index 1a160755..28dfcbf6 100644
--- a/src/prefs_filter.c
+++ b/src/prefs_filter.c
@@ -74,8 +74,6 @@ static GdkBitmap *markxpmmask;
static void prefs_filter_create (void);
-//static void prefs_filter_read_old_config (void);
-
static void prefs_filter_set_dialog (void);
static void prefs_filter_set_list_row (gint row,
FilterRule *rule,
@@ -328,13 +326,17 @@ void prefs_filter_read_config(void)
rule);
}
-#warning FIXME_GTK2
rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, FILTER_LIST,
NULL);
if (!is_file_exist(rcpath)) {
- //prefs_filter_read_old_config();
+ debug_print("reading older version of filter.xml ...\n");
g_free(rcpath);
- return;
+ rcpath = g_strconcat(get_old_rc_dir(), G_DIR_SEPARATOR_S,
+ FILTER_LIST, NULL);
+ if (!is_file_exist(rcpath)) {
+ g_free(rcpath);
+ return;
+ }
}
node = xml_parse_file(rcpath);
@@ -350,37 +352,6 @@ void prefs_filter_read_config(void)
xml_free_tree(node);
}
-#if 0
-static void prefs_filter_read_old_config(void)
-{
- gchar *rcpath;
- FILE *fp;
- gchar buf[PREFSBUFSIZE];
- FilterRule *rule;
-
- debug_print("Reading old filter configuration...\n");
-
- rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, FILTER_RC, NULL);
- if ((fp = fopen(rcpath, "rb")) == NULL) {
- if (ENOENT != errno) FILE_OP_ERROR(rcpath, "fopen");
- g_free(rcpath);
- return;
- }
- g_free(rcpath);
-
- while (fgets(buf, sizeof(buf), fp) != NULL) {
- g_strchomp(buf);
- rule = filter_read_str(buf);
- if (rule) {
- prefs_common.fltlist =
- g_slist_append(prefs_common.fltlist, rule);
- }
- }
-
- fclose(fp);
-}
-#endif
-
void prefs_filter_write_config(void)
{
filter_write_config(prefs_common.fltlist);