aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-07-20 07:10:46 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-07-20 07:10:46 +0000
commit0c4c0340a8cf4a7be69fc0d8e45902d73363b4aa (patch)
tree2c0b62cc11b99a26a3722ac71c446a360b39fbee /src
parentca8ebeb05ab140f3114d82edc0a85b69e5dc6aa8 (diff)
remove temporary files on startup.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@438 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r--src/main.c48
1 files changed, 28 insertions, 20 deletions
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());