diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-01-24 09:37:00 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-01-24 09:37:00 +0000 |
commit | 21fb7010272990c1f9a9e0fdd09e3bae48855a12 (patch) | |
tree | 5223b78ddb35f19583fa3dc4a33848d5f283e969 /src | |
parent | 1e2e2b3010c8474ef0b5d93b7c20af5eead5c31d (diff) |
also migrate sylpheedrc.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@37 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r-- | src/defs.h | 13 | ||||
-rw-r--r-- | src/main.c | 40 | ||||
-rw-r--r-- | src/pop.c | 13 | ||||
-rw-r--r-- | src/prefs_common.c | 12 |
4 files changed, 39 insertions, 39 deletions
@@ -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__ */ @@ -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; @@ -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", |