aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-01-24 09:37:00 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-01-24 09:37:00 +0000
commit21fb7010272990c1f9a9e0fdd09e3bae48855a12 (patch)
tree5223b78ddb35f19583fa3dc4a33848d5f283e969
parent1e2e2b3010c8474ef0b5d93b7c20af5eead5c31d (diff)
also migrate sylpheedrc.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@37 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog9
-rw-r--r--ChangeLog.ja8
-rw-r--r--src/defs.h13
-rw-r--r--src/main.c40
-rw-r--r--src/pop.c13
-rw-r--r--src/prefs_common.c12
6 files changed, 56 insertions, 39 deletions
diff --git a/ChangeLog b/ChangeLog
index cf45d9aa..f5af7d4c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2005-01-24
+ * src/pop.c: pop3_get_uidl_table(): removed the old code for
+ migration.
+ * src/main.c: migrate_old_config(): also migrate sylpheedrc, and
+ check the existence of source files.
+ * src/prefs_common.c: changed the font setting name for migration.
+ * src/defs.h: added UIDL_DIR, and changed the default font.
+
+2005-01-24
+
* src/compose.c
src/addressbook.c
src/messageview.c
diff --git a/ChangeLog.ja b/ChangeLog.ja
index efbe7744..4024d241 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,5 +1,13 @@
2005-01-24
+ * src/pop.c: pop3_get_uidl_table(): 移行用の古いコードを削除。
+ * src/main.c: migrate_old_config(): sylpheedrc も移行するようにし、
+ 元ファイルの存在をチェックするようにした。
+ * src/prefs_common.c: 移行のためにフォントの設定名を変更。
+ * src/defs.h: UIDL_DIR を追加し、デフォルトのフォントを変更。
+
+2005-01-24
+
* src/compose.c
src/addressbook.c
src/messageview.c
diff --git a/src/defs.h b/src/defs.h
index 68c051e8..f31b5306 100644
--- a/src/defs.h
+++ b/src/defs.h
@@ -1,6 +1,6 @@
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2004 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 Hiroyuki Yamamoto
*
* 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
@@ -54,6 +54,7 @@
#define COMMAND_HISTORY "command_history"
#define TEMPLATE_DIR "templates"
#define TMP_DIR "tmp"
+#define UIDL_DIR "uidl"
#define NEWSGROUP_LIST ".newsgroup_list"
#define ADDRESS_BOOK "addressbook.xml"
#define MANUAL_HTML_INDEX "sylpheed.html"
@@ -102,10 +103,10 @@
#define SESSION_TIMEOUT_INTERVAL 60 /* sec */
#define MAX_HISTORY_SIZE 16
-#define DEFAULT_NORMAL_FONT "Helvetica 12"
-#define DEFAULT_MESSAGE_FONT "Helvetica 14"
-#define DEFAULT_BOLD_FONT "Helvetica Bold 12"
-#define DEFAULT_SMALL_FONT "Helvetica 10"
-#define DEFAULT_TITLE_FONT "Helvetica 16"
+#define DEFAULT_NORMAL_FONT "Sans 12"
+#define DEFAULT_MESSAGE_FONT "Sans 14"
+#define DEFAULT_BOLD_FONT "Sans Bold 12"
+#define DEFAULT_SMALL_FONT "Sans 10"
+#define DEFAULT_TITLE_FONT "Sans 16"
#endif /* __DEFS_H__ */
diff --git a/src/main.c b/src/main.c
index b48f0c6b..4f6354bf 100644
--- a/src/main.c
+++ b/src/main.c
@@ -224,7 +224,7 @@ int main(int argc, char *argv[])
MAKE_DIR_IF_NOT_EXIST(get_news_cache_dir());
MAKE_DIR_IF_NOT_EXIST(get_mime_tmp_dir());
MAKE_DIR_IF_NOT_EXIST(get_tmp_dir());
- MAKE_DIR_IF_NOT_EXIST(RC_DIR G_DIR_SEPARATOR_S "uidl");
+ MAKE_DIR_IF_NOT_EXIST(RC_DIR G_DIR_SEPARATOR_S UIDL_DIR);
if (is_file_exist(RC_DIR G_DIR_SEPARATOR_S "sylpheed.log")) {
if (rename(RC_DIR G_DIR_SEPARATOR_S "sylpheed.log",
@@ -702,33 +702,37 @@ static void migrate_old_config(void)
debug_print("Migrating old configuration...\n");
-#define COPY_FILE(rcfile) \
- conv_copy_file(OLD_RC_DIR G_DIR_SEPARATOR_S rcfile, \
- RC_DIR G_DIR_SEPARATOR_S rcfile, \
- conv_get_locale_charset_str())
+#define COPY_FILE(rcfile) \
+ if (is_file_exist(OLD_RC_DIR G_DIR_SEPARATOR_S rcfile)) { \
+ conv_copy_file(OLD_RC_DIR G_DIR_SEPARATOR_S rcfile, \
+ RC_DIR G_DIR_SEPARATOR_S rcfile, \
+ conv_get_locale_charset_str()); \
+ }
COPY_FILE(ACCOUNT_RC);
COPY_FILE(ACTIONS_RC);
+ COPY_FILE(COMMON_RC);
COPY_FILE(CUSTOM_HEADER_RC);
COPY_FILE(DISPLAY_HEADER_RC);
COPY_FILE(FILTER_HEADER_RC);
-#if 0
- COPY_FILE(COMMON_RC);
-#endif
COPY_FILE(COMMAND_HISTORY);
#undef COPY_FILE
- copy_file(OLD_RC_DIR G_DIR_SEPARATOR_S FILTER_LIST,
- RC_DIR G_DIR_SEPARATOR_S FILTER_LIST, FALSE);
- copy_file(OLD_RC_DIR G_DIR_SEPARATOR_S FOLDER_LIST,
- RC_DIR G_DIR_SEPARATOR_S FOLDER_LIST, FALSE);
-
- conv_copy_dir(OLD_RC_DIR G_DIR_SEPARATOR_S TEMPLATE_DIR,
- RC_DIR G_DIR_SEPARATOR_S TEMPLATE_DIR,
- conv_get_locale_charset_str());
- copy_dir(OLD_RC_DIR G_DIR_SEPARATOR_S "uidl",
- RC_DIR G_DIR_SEPARATOR_S "uidl");
+ if (is_file_exist(OLD_RC_DIR G_DIR_SEPARATOR_S FILTER_LIST))
+ copy_file(OLD_RC_DIR G_DIR_SEPARATOR_S FILTER_LIST,
+ RC_DIR G_DIR_SEPARATOR_S FILTER_LIST, FALSE);
+ if (is_file_exist(OLD_RC_DIR G_DIR_SEPARATOR_S FOLDER_LIST))
+ copy_file(OLD_RC_DIR G_DIR_SEPARATOR_S FOLDER_LIST,
+ RC_DIR G_DIR_SEPARATOR_S FOLDER_LIST, FALSE);
+
+ if (is_dir_exist(OLD_RC_DIR G_DIR_SEPARATOR_S TEMPLATE_DIR))
+ conv_copy_dir(OLD_RC_DIR G_DIR_SEPARATOR_S TEMPLATE_DIR,
+ RC_DIR G_DIR_SEPARATOR_S TEMPLATE_DIR,
+ conv_get_locale_charset_str());
+ if (is_dir_exist(OLD_RC_DIR G_DIR_SEPARATOR_S UIDL_DIR))
+ copy_dir(OLD_RC_DIR G_DIR_SEPARATOR_S UIDL_DIR,
+ RC_DIR G_DIR_SEPARATOR_S UIDL_DIR);
if (!is_file_exist(OLD_RC_DIR G_DIR_SEPARATOR_S ADDRESSBOOK_INDEX_FILE))
return;
diff --git a/src/pop.c b/src/pop.c
index 483a076f..d4c3e873 100644
--- a/src/pop.c
+++ b/src/pop.c
@@ -21,6 +21,8 @@
# include "config.h"
#endif
+#include "defs.h"
+
#include <glib.h>
#include <stdio.h>
#include <string.h>
@@ -454,19 +456,12 @@ GHashTable *pop3_get_uidl_table(PrefsAccount *ac_prefs)
table = g_hash_table_new(g_str_hash, g_str_equal);
path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
- "uidl", G_DIR_SEPARATOR_S, ac_prefs->recv_server,
+ UIDL_DIR, G_DIR_SEPARATOR_S, ac_prefs->recv_server,
"-", ac_prefs->userid, NULL);
if ((fp = fopen(path, "rb")) == NULL) {
if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
g_free(path);
- path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
- "uidl-", ac_prefs->recv_server,
- "-", ac_prefs->userid, NULL);
- if ((fp = fopen(path, "rb")) == NULL) {
- if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
- g_free(path);
- return table;
- }
+ return table;
}
g_free(path);
diff --git a/src/prefs_common.c b/src/prefs_common.c
index bfe6a8d0..5fdc9b07 100644
--- a/src/prefs_common.c
+++ b/src/prefs_common.c
@@ -338,17 +338,17 @@ static PrefParam param[] = {
prefs_set_data_from_text, prefs_set_text},
/* Display */
- {"widget_font", NULL, &prefs_common.widgetfont, P_STRING,
+ {"widget_font_name", NULL, &prefs_common.widgetfont, P_STRING,
NULL, NULL, NULL},
- {"message_font", DEFAULT_MESSAGE_FONT, &prefs_common.textfont, P_STRING,
+ {"message_font_name", DEFAULT_MESSAGE_FONT, &prefs_common.textfont, P_STRING,
&display.entry_textfont, prefs_set_data_from_entry, prefs_set_entry},
- {"normal_font", DEFAULT_NORMAL_FONT, &prefs_common.normalfont, P_STRING,
+ {"normal_font_name", DEFAULT_NORMAL_FONT, &prefs_common.normalfont, P_STRING,
NULL, NULL, NULL},
- {"bold_font", DEFAULT_BOLD_FONT, &prefs_common.boldfont, P_STRING,
+ {"bold_font_name", DEFAULT_BOLD_FONT, &prefs_common.boldfont, P_STRING,
NULL, NULL, NULL},
- {"small_font", DEFAULT_SMALL_FONT, &prefs_common.smallfont, P_STRING,
+ {"small_font_name", DEFAULT_SMALL_FONT, &prefs_common.smallfont, P_STRING,
NULL, NULL, NULL},
- {"title_font", DEFAULT_TITLE_FONT, &prefs_common.titlefont, P_STRING,
+ {"title_font_name", DEFAULT_TITLE_FONT, &prefs_common.titlefont, P_STRING,
NULL, NULL, NULL},
{"display_folder_unread_num", "TRUE",