From 0c4c0340a8cf4a7be69fc0d8e45902d73363b4aa Mon Sep 17 00:00:00 2001 From: hiro Date: Wed, 20 Jul 2005 07:10:46 +0000 Subject: remove temporary files on startup. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@438 ee746299-78ed-0310-b773-934348b2243d --- ChangeLog | 4 ++++ ChangeLog.ja | 4 ++++ src/main.c | 48 ++++++++++++++++++++++++++++-------------------- 3 files changed, 36 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 25d654a4..7a653134 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-07-20 + + * src/main.c: remove temporary files on startup. Code cleanups. + 2005-07-19 * src/compose.c: compose_insert_drag_received_cb(): added a hack to diff --git a/ChangeLog.ja b/ChangeLog.ja index 2f596677..1e1ce13e 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,7 @@ +2005-07-20 + + * src/main.c: 起動時に一時ファイルを削除。コードの整理。 + 2005-07-19 * src/compose.c: compose_insert_drag_received_cb(): 重複して挿入して diff --git a/src/main.c b/src/main.c index 5b7c37ac..82d09a55 100644 --- a/src/main.c +++ b/src/main.c @@ -249,6 +249,10 @@ int main(int argc, char *argv[]) MAKE_DIR_IF_NOT_EXIST(get_tmp_dir()); MAKE_DIR_IF_NOT_EXIST(RC_DIR G_DIR_SEPARATOR_S UIDL_DIR); + /* remove temporary files */ + remove_all_files(get_tmp_dir()); + remove_all_files(get_mime_tmp_dir()); + if (is_file_exist(RC_DIR G_DIR_SEPARATOR_S "sylpheed.log")) { if (rename(RC_DIR G_DIR_SEPARATOR_S "sylpheed.log", RC_DIR G_DIR_SEPARATOR_S "sylpheed.log.bak") < 0) @@ -259,22 +263,26 @@ int main(int argc, char *argv[]) prefs_common_read_config(); #if USE_GPGME - if (gpgme_check_version("0.4.5")) { /* Also does some gpgme init */ - gpgme_engine_info_t engineInfo; + if (gpgme_check_version("0.4.5")) { + /* Also does some gpgme init */ + gpgme_engine_info_t engineInfo; + rfc2015_disable_all(); - gpgme_set_locale(NULL, LC_CTYPE, setlocale(LC_CTYPE, NULL)); - gpgme_set_locale(NULL, LC_MESSAGES, setlocale(LC_MESSAGES, NULL)); - - if (!gpgme_get_engine_info(&engineInfo)) { - while (engineInfo) { - debug_print("GpgME Protocol: %s\n Version: %s\n", - gpgme_get_protocol_name(engineInfo->protocol), - engineInfo->version); - engineInfo = engineInfo->next; - } - } - } else { + gpgme_set_locale(NULL, LC_CTYPE, setlocale(LC_CTYPE, NULL)); + gpgme_set_locale(NULL, LC_MESSAGES, + setlocale(LC_MESSAGES, NULL)); + + if (!gpgme_get_engine_info(&engineInfo)) { + while (engineInfo) { + debug_print("GpgME Protocol: %s\n Version: %s\n", + gpgme_get_protocol_name + (engineInfo->protocol), + engineInfo->version); + engineInfo = engineInfo->next; + } + } + } else { if (prefs_common.gpg_warning) { AlertValue val; @@ -287,12 +295,12 @@ int main(int argc, char *argv[]) prefs_common.gpg_warning = FALSE; } } - /* FIXME: This function went away. We can either block until gpgme - * operations finish (currently implemented) or register callbacks - * with the gtk main loop via the gpgme io callback interface instead. - * + /* FIXME: This function went away. We can either block until gpgme + * operations finish (currently implemented) or register callbacks + * with the gtk main loop via the gpgme io callback interface instead. + * * gpgme_register_idle(idle_function_for_gpgme); - */ + */ #endif sock_set_io_timeout(prefs_common.io_timeout_secs); @@ -521,7 +529,7 @@ void app_will_exit(GtkWidget *widget, gpointer data) gtk_accel_map_save(filename); g_free(filename); - /* delete temporary files */ + /* remove temporary files */ remove_all_files(get_tmp_dir()); remove_all_files(get_mime_tmp_dir()); -- cgit v1.2.3