From a1c7c6ef0e18fce583a215a9806208d4db43ccaa Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 2 Jun 2000 18:46:50 +0000 Subject: keep a GList of folder browsers created (owner_unset_cb): Go through the * component-factory.c (create_view): keep a GList of folder browsers created (owner_unset_cb): Go through the list and close each folder before exiting so they sync their summary state, etc to disk. svn path=/trunk/; revision=3393 --- mail/component-factory.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mail/component-factory.c') diff --git a/mail/component-factory.c b/mail/component-factory.c index cf67836827..adc8380754 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -33,6 +33,7 @@ #include "evolution-shell-component.h" #include "folder-browser.h" #include "mail.h" /* YUCK FIXME */ +#include "e-util/e-gui-utils.h" #include "filter/filter-driver.h" #include "component-factory.h" @@ -53,6 +54,8 @@ static const EvolutionShellComponentFolderType folder_types[] = { { NULL, NULL } }; +static GList *browsers; + /* EvolutionShellComponent methods and signals. */ @@ -71,6 +74,8 @@ create_view (EvolutionShellComponent *shell_component, g_assert (folder_browser_widget != NULL); g_assert (IS_FOLDER_BROWSER (folder_browser_widget)); + browsers = g_list_prepend (browsers, folder_browser_widget); + /* dum de dum, hack to let the folder browser know the storage its in */ gtk_object_set_data((GtkObject *)folder_browser_widget, "e-storage", gtk_object_get_data((GtkObject *)shell_component, "e-storage")); @@ -94,6 +99,18 @@ owner_set_cb (EvolutionShellComponent *shell_component, static void owner_unset_cb (EvolutionShellComponent *shell_component, gpointer user_data) { + FolderBrowser *fb; + + /* Close each open folder to make them sync their state to + * disk. We should do more cleanup than this, but then, we shouldn't + * be just exiting here either. FIXME. + */ + while (browsers) { + fb = browsers->data; + camel_folder_close (fb->folder, FALSE, NULL); + browsers = browsers->next; + } + gtk_main_quit (); } -- cgit v1.2.3