0.9.7claws46
authorChristoph Hohmann <reboot@gmx.ch>
Tue, 16 Dec 2003 16:07:24 +0000 (16:07 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Tue, 16 Dec 2003 16:07:24 +0000 (16:07 +0000)
* src/main.c
        make sure the shutdown process only runs once

ChangeLog.claws
configure.ac
src/main.c

index 7b289ec447472442eb232dcde5242bfcfcbc29fb..7d9bc444278c4be702abad9576c66ea822442bc9 100644 (file)
@@ -1,3 +1,8 @@
+2003-12-16 [christoph] 0.9.7claws46
+
+       * src/main.c
+               make sure the shutdown process only runs once
+
 2003-12-16 [hoa]       0.9.7claws45
 
        * src/mainwindow.c
@@ -26,8 +31,9 @@
                        X "bogofilter < %F" 
                
                gets me all the spam in a folder.
-               
+
 2003-12-14 [luke]      0.9.7claws41
+
        * src/textview.c
        * src/mimeview.c
                o use parameter "filename" instead of "name" in a couple of 
index e6169f1d7d678275fbfa1c2a12feab2a9c95475e..c041d70fb26eb7a3b75bcd36ec36b09e8794f4c9 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=7
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=44
+EXTRA_VERSION=46
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index e378c2e78dab3463db42a6d32d172bd9d86ba7a3..033d1c3cedaf5b4b791d1f2a43950516f07d9e07 100644 (file)
@@ -136,6 +136,7 @@ static void send_queue                      (void);
 static void initial_processing         (FolderItem *item, gpointer data);
 static void quit_signal_handler         (int sig);
 static void install_basic_sighandlers   (void);
+static void exit_sylpheed              (MainWindow *mainwin);
 
 #if 0
 /* for gettext */
@@ -352,6 +353,69 @@ int main(int argc, char *argv[])
        static_mainwindow = mainwin;
        gtk_main();
 
+       exit_sylpheed(mainwin);
+
+       return 0;
+}
+
+static void save_all_caches(FolderItem *item, gpointer data)
+{
+       if (!item->cache)
+               return;
+       folder_item_write_cache(item);
+}
+
+static void exit_sylpheed(MainWindow *mainwin)
+{
+       gchar *filename;
+       GList *list;
+
+       debug_print("shutting down\n");
+
+       inc_autocheck_timer_remove();
+
+       if (prefs_common.clean_on_exit)
+               main_window_empty_trash(mainwin, prefs_common.ask_on_clean);
+
+       /* save prefs for opened folder */
+       if(mainwin->folderview->opened)
+       {
+               FolderItem *item;
+
+               item = gtk_ctree_node_get_row_data(GTK_CTREE(mainwin->folderview->ctree), mainwin->folderview->opened);
+               summary_save_prefs_to_folderitem(mainwin->folderview->summaryview, item);
+       }
+
+       /* 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);
+       prefs_common_save_config();
+       account_save_config_all();
+       addressbook_export_to_file();
+
+       filename = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, MENU_RC, NULL);
+       gtk_item_factory_dump_rc(filename, NULL, TRUE);
+       g_free(filename);
+
+       /* delete temporary files */
+       remove_all_files(get_mime_tmp_dir());
+
+       close_log_file();
+
+       /* delete crashfile */
+       if (!cmd.crash)
+               unlink(get_crashfile_name());
+
+       lock_socket_remove();
+
        main_window_destroy(mainwin);
        
        plugin_unload_all("GTK");
@@ -372,7 +436,6 @@ int main(int argc, char *argv[])
 #endif
        sylpheed_done();
 
-       return 0;
 }
 
 static void parse_cmd_opt(int argc, char *argv[])
@@ -497,13 +560,6 @@ static gint get_queued_message_num(void)
        return queue->total_msgs;
 }
 
-static void save_all_caches(FolderItem *item, gpointer data)
-{
-       if (!item->cache)
-               return;
-       folder_item_write_cache(item);
-}
-
 static void initial_processing(FolderItem *item, gpointer data)
 {
        MainWindow *mainwin = (MainWindow *)data;
@@ -566,15 +622,7 @@ gboolean clean_quit(gpointer data)
                
        draft_all_messages();
 
-       if (prefs_common.warn_queued_on_exit) { 
-               /* disable the popup */ 
-               prefs_common.warn_queued_on_exit = FALSE;       
-               app_will_exit(NULL, static_mainwindow);
-               prefs_common.warn_queued_on_exit = TRUE;
-               prefs_common_save_config();
-       } else {
-               app_will_exit(NULL, static_mainwindow);
-       }
+       exit_sylpheed(static_mainwindow);
        exit(0);
 
        return FALSE;
@@ -583,8 +631,6 @@ gboolean clean_quit(gpointer data)
 void app_will_exit(GtkWidget *widget, gpointer data)
 {
        MainWindow *mainwin = data;
-       gchar *filename;
-       GList *list;
        
        if (compose_get_compose_list()) {
                gint val = alertpanel(_("Notice"),
@@ -609,51 +655,6 @@ void app_will_exit(GtkWidget *widget, gpointer data)
                        return;
                manage_window_focus_in(mainwin->window, NULL, NULL);
        }
-
-       inc_autocheck_timer_remove();
-
-       if (prefs_common.clean_on_exit)
-               main_window_empty_trash(mainwin, prefs_common.ask_on_clean);
-
-       /* save prefs for opened folder */
-       if(mainwin->folderview->opened)
-       {
-               FolderItem *item;
-
-               item = gtk_ctree_node_get_row_data(GTK_CTREE(mainwin->folderview->ctree), mainwin->folderview->opened);
-               summary_save_prefs_to_folderitem(mainwin->folderview->summaryview, item);
-       }
-
-       /* 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);
-       prefs_common_save_config();
-       account_save_config_all();
-       addressbook_export_to_file();
-
-       filename = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, MENU_RC, NULL);
-       gtk_item_factory_dump_rc(filename, NULL, TRUE);
-       g_free(filename);
-
-       /* delete temporary files */
-       remove_all_files(get_mime_tmp_dir());
-
-       close_log_file();
-
-       /* delete crashfile */
-       if (!cmd.crash)
-               unlink(get_crashfile_name());
-
-       lock_socket_remove();
-
        gtk_main_quit();
 }