partial sync with 0.9.3cvs21
[claws.git] / src / main.c
index 178c6a30f70d0b7b4f232347877e7218d07df8e7..0707335cc1d764d1d2f19f5ede1ced498f4e668d 100644 (file)
@@ -274,11 +274,8 @@ int main(int argc, char *argv[])
        
        sock_set_io_timeout(prefs_common.io_timeout_secs);
 
-       prefs_common_save_config();
        prefs_actions_read_config();
-       prefs_actions_write_config();
        prefs_display_header_read_config();
-       prefs_display_header_write_config();
        /* prefs_filtering_read_config(); */
        addressbook_read_file();
        renderer_read_config();
@@ -296,7 +293,6 @@ int main(int argc, char *argv[])
                                        mainwin);
 
        account_read_config_all();
-       account_save_config_all();
 
        if (folder_read_list() < 0) {
                setup(mainwin);
@@ -474,12 +470,16 @@ static void parse_cmd_opt(int argc, char *argv[])
                        puts(_("  --debug                debug mode"));
                        puts(_("  --help                 display this help and exit"));
                        puts(_("  --version              output version information and exit"));
+                       puts(_("  --config-dir           output configuration directory"));
 
                        exit(1);
                } else if (!strncmp(argv[i], "--crash", 7)) {
                        cmd.crash = TRUE;
                        cmd.crash_params = g_strdup(argv[i + 1]);
                        i++;
+               } else if (!strncmp(argv[i], "--config-dir", sizeof "--config-dir" - 1)) {
+                       puts(RC_DIR);
+                       exit(0);
                }
                
        }
@@ -579,6 +579,7 @@ void app_will_exit(GtkWidget *widget, gpointer data)
 {
        MainWindow *mainwin = data;
        gchar *filename;
+       GList *list;
        
        if (compose_get_compose_list()) {
                gint val = alertpanel(_("Notice"),
@@ -625,6 +626,11 @@ void app_will_exit(GtkWidget *widget, gpointer data)
        /* save all state before exiting */
        folder_write_list();
        folder_func_to_all_folders(save_all_caches, NULL);
+       for (list = folder_get_list(); list != NULL; list = g_list_next(list)) {
+               Folder *folder = FOLDER(list->data);
+
+               folder_tree_destroy(folder);
+       }
 
        main_window_get_size(mainwin);
        main_window_get_position(mainwin);