aboutsummaryrefslogtreecommitdiffstats
path: root/mail/component-factory.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-06-03 02:46:50 +0800
committerDan Winship <danw@src.gnome.org>2000-06-03 02:46:50 +0800
commita1c7c6ef0e18fce583a215a9806208d4db43ccaa (patch)
tree485271053e40a995ed8b33edfa8dcd35c724763f /mail/component-factory.c
parenta9959a65c24cb76ee1d770b6a453486e80d55daf (diff)
downloadgsoc2013-evolution-a1c7c6ef0e18fce583a215a9806208d4db43ccaa.tar
gsoc2013-evolution-a1c7c6ef0e18fce583a215a9806208d4db43ccaa.tar.gz
gsoc2013-evolution-a1c7c6ef0e18fce583a215a9806208d4db43ccaa.tar.bz2
gsoc2013-evolution-a1c7c6ef0e18fce583a215a9806208d4db43ccaa.tar.lz
gsoc2013-evolution-a1c7c6ef0e18fce583a215a9806208d4db43ccaa.tar.xz
gsoc2013-evolution-a1c7c6ef0e18fce583a215a9806208d4db43ccaa.tar.zst
gsoc2013-evolution-a1c7c6ef0e18fce583a215a9806208d4db43ccaa.zip
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
Diffstat (limited to 'mail/component-factory.c')
-rw-r--r--mail/component-factory.c17
1 files changed, 17 insertions, 0 deletions
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 ();
}