aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-browser.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2008-08-18 12:37:15 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-08-18 12:37:15 +0800
commitf19618ac7f06b7f9e4bb2d7ce2e75de6e8554737 (patch)
treed6481a36d0a743a7b7ccbd249c94f76cd707d6ae /mail/em-folder-browser.c
parentfce40453c9aece0fcdd523fe80ff1cc573747844 (diff)
downloadgsoc2013-evolution-f19618ac7f06b7f9e4bb2d7ce2e75de6e8554737.tar.gz
gsoc2013-evolution-f19618ac7f06b7f9e4bb2d7ce2e75de6e8554737.tar.zst
gsoc2013-evolution-f19618ac7f06b7f9e4bb2d7ce2e75de6e8554737.zip
** Fixes bug #508732
2008-08-18 Matthew Barnes <mbarnes@redhat.com> ** Fixes bug #508732 * shell/e-shell.c: Add a "crash_recovery" flag, with accessor functions for it. * shell/e-shell-window (init_view): Check and reset the "crash_recovery" flag before creating a new shell view. The components can use this flag to take steps to recover from the previous crash. * shell/apps_evolution_shell.schemas.in: Remove the "skip_recovery_dialog" and "recovery" keys. * shell/Evolution-Component.idl (createView): Add a "select_item" boolean parameter. * shell/main.c: Kill the crash recovery dialog. Instead just set the crash recovery flag in e-shell appropriately. * mail/mail-component.c (impl_createView): Add a "select_item" argument for crash recovery, which we forward to EMFolderBrowser as a "suppress_message_selection" flag. * mail/em-folder-browser.c (emfb_set_folder): Suppress automatic message selection if we are recovering from a crash. * addressbook/gui/component/addressbook-component.c (impl_createView): * calendar/gui/calendar-component.c (impl_createView): * calendar/gui/memos-component.c (impl_createView): * calendar/gui/tasks-component.c (impl_createView): Add a "select_item" argument for crash recovery, which these components do not use. * help/C/evolution.xml: Remove the bit about crash recovery. svn path=/trunk/; revision=36009
Diffstat (limited to 'mail/em-folder-browser.c')
-rw-r--r--mail/em-folder-browser.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c
index fff9fa7c98..9bbf061cc8 100644
--- a/mail/em-folder-browser.c
+++ b/mail/em-folder-browser.c
@@ -122,6 +122,7 @@ struct _EMFolderBrowserPrivate {
guint folder_changed_id;
guint show_wide:1;
+ guint suppress_message_selection:1;
gboolean scope_restricted;
EMMenu *menu; /* toplevel menu manager */
@@ -2007,6 +2008,7 @@ emfb_set_folder(EMFolderView *emfv, CamelFolder *folder, const char *uri)
{
EMFolderBrowser *emfb = (EMFolderBrowser *) emfv;
struct _EMFolderBrowserPrivate *p = emfb->priv;
+ gboolean different_folder;
message_list_freeze(emfv->list);
@@ -2025,6 +2027,10 @@ emfb_set_folder(EMFolderView *emfv, CamelFolder *folder, const char *uri)
emfb->priv->folder_changed_id = 0;
}
+ different_folder =
+ emfb->view.folder != NULL &&
+ folder != emfb->view.folder;
+
emfb_parent->set_folder(emfv, folder, uri);
/* This is required since we get activated the first time
@@ -2108,15 +2114,20 @@ emfb_set_folder(EMFolderView *emfv, CamelFolder *folder, const char *uri)
e_search_bar_paint ((ESearchBar *)emfb->search);
}
- /* set the query manually, so we dont pop up advanced or saved search stuff */
+ /* This function gets triggered several times at startup,
+ * so we don't want to reset the message suppression state
+ * unless we're actually switching to a different folder. */
+ if (different_folder)
+ p->suppress_message_selection = FALSE;
- if ((sstate = camel_object_meta_get (folder, "evolution:selected_uid"))) {
- g_free (emfb->priv->select_uid);
- emfb->priv->select_uid = sstate;
- } else {
- g_free(p->select_uid);
- p->select_uid = NULL;
- }
+ if (!p->suppress_message_selection)
+ sstate = camel_object_meta_get (
+ folder, "evolution:selected_uid");
+ else
+ sstate = NULL;
+
+ g_free (p->select_uid);
+ p->select_uid = sstate;
if (emfv->list->cursor_uid == NULL && emfb->priv->list_built_id == 0)
p->list_built_id = g_signal_connect(emfv->list, "message_list_built", G_CALLBACK (emfb_list_built), emfv);
@@ -2228,3 +2239,9 @@ emfb_activate(EMFolderView *emfv, BonoboUIComponent *uic, int act)
emfb_parent->activate(emfv, uic, act);
}
}
+
+void
+em_folder_browser_suppress_message_selection (EMFolderBrowser *emfb)
+{
+ emfb->priv->suppress_message_selection = TRUE;
+}