aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-01-20 12:32:41 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-01-20 12:32:41 +0800
commitb6e44f08f719efee9c6ed90813d03ddbf42e9121 (patch)
tree974bfa73c331fbf44c829286dc5aa1e3acf1dfc3 /mail
parent1d92e96ba8027cd5677fee5313bae50336a75e9a (diff)
downloadgsoc2013-evolution-b6e44f08f719efee9c6ed90813d03ddbf42e9121.tar.gz
gsoc2013-evolution-b6e44f08f719efee9c6ed90813d03ddbf42e9121.tar.zst
gsoc2013-evolution-b6e44f08f719efee9c6ed90813d03ddbf42e9121.zip
Make displayed_uid public.
2004-01-20 Not Zed <NotZed@Ximian.com> * em-folder-view.c (EMFolderView): Make displayed_uid public. * em-folder-browser.c (em_folder_browser_show_preview): use em_folder_view_set_message rather than message_list_select_uid. When clearing, clear view->displayed_uid too. 2004-01-20 Not Zed <NotZed@Ximian.com> ** See bug #52965. * mail-component.c (mail_component_init): removed an epfixme, it already is an object. (impl_upgradeFromVersion): call mail_note_store after running the upgrade for local folders. * em-migrate.c (em_migrate): revert the vfolders.xml after we've imported them. * mail-vfolder.c (vfolder_revert): new api to re-load the vfolders file. svn path=/trunk/; revision=24322
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog21
-rw-r--r--mail/em-folder-browser.c8
-rw-r--r--mail/em-folder-view.c14
-rw-r--r--mail/em-folder-view.h2
-rw-r--r--mail/em-migrate.c2
-rw-r--r--mail/mail-component.c21
-rw-r--r--mail/mail-vfolder.c11
-rw-r--r--mail/mail-vfolder.h1
8 files changed, 63 insertions, 17 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 2fef03451b..8df78b3d0e 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,26 @@
2004-01-20 Not Zed <NotZed@Ximian.com>
+ * em-folder-view.c (EMFolderView): Make displayed_uid public.
+
+ * em-folder-browser.c (em_folder_browser_show_preview): use
+ em_folder_view_set_message rather than message_list_select_uid.
+ When clearing, clear view->displayed_uid too.
+
+2004-01-20 Not Zed <NotZed@Ximian.com>
+
+ ** See bug #52965.
+
+ * mail-component.c (mail_component_init): removed an epfixme, it
+ already is an object.
+ (impl_upgradeFromVersion): call mail_note_store after running the
+ upgrade for local folders.
+
+ * em-migrate.c (em_migrate): revert the vfolders.xml after we've
+ imported them.
+
+ * mail-vfolder.c (vfolder_revert): new api to re-load the vfolders
+ file.
+
** See bug #52885.
* em-folder-browser.c (emfb_create_view_menus): unref the view
diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c
index d8bc18c7fe..b30633481d 100644
--- a/mail/em-folder-browser.c
+++ b/mail/em-folder-browser.c
@@ -115,6 +115,8 @@ static void emfb_search_query_changed(ESearchBar *esb, EMFolderBrowser *emfb);
static int emfb_list_key_press(ETree *tree, int row, ETreePath path, int col, GdkEvent *ev, EMFolderBrowser *emfb);
static void emfb_list_message_selected (MessageList *ml, const char *uid, EMFolderBrowser *emfb);
+static void emfb_create_view_menus(EMFolderBrowser *emfb, BonoboUIComponent *uic);
+
static const EMFolderViewEnable emfb_enable_map[];
enum {
@@ -298,13 +300,17 @@ void em_folder_browser_show_preview(EMFolderBrowser *emfb, gboolean state)
gtk_widget_show (GTK_WIDGET (emfb->priv->preview));
if (emfb->view.list->cursor_uid)
- message_list_select_uid(emfb->view.list, emfb->view.list->cursor_uid);
+ em_folder_view_set_message(&emfb->view, emfb->view.list->cursor_uid);
/* need to load/show the current message? */
/*do_message_selected (emfb);*/
/*set_cursor_pos (emfb, y);*/
} else {
em_format_format((EMFormat *)emfb->view.preview, NULL, NULL, NULL);
+
+ g_free(emfb->view.displayed_uid);
+ emfb->view.displayed_uid = NULL;
+
gtk_widget_hide(emfb->priv->preview);
/*
mail_display_set_message (emfb->mail_display, NULL, NULL, NULL);
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index 66835a56a8..8d9d39f1ff 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -113,8 +113,6 @@ static const EMFolderViewEnable emfv_enable_map[];
struct _EMFolderViewPrivate {
guint seen_id;
guint setting_notify_id;
-
- char *displayed_uid; /* only used to stop re-loads, don't use it to represent any selection state */
CamelObjectHookID folder_changed_id, message_changed_id;
@@ -400,6 +398,8 @@ static void
emfv_set_message(EMFolderView *emfv, const char *uid)
{
message_list_select_uid(emfv->list, uid);
+ /* force an update, since we may not get an updated event if we select the same uid */
+ emfv_list_message_selected(emfv->list, uid, emfv);
}
/* ********************************************************************** */
@@ -1734,14 +1734,14 @@ emfv_list_message_selected(MessageList *ml, const char *uid, EMFolderView *emfv)
if (emfv->preview_active) {
if (uid) {
- if (emfv->priv->displayed_uid == NULL || strcmp(emfv->priv->displayed_uid, uid) != 0) {
- g_free(emfv->priv->displayed_uid);
- emfv->priv->displayed_uid = g_strdup(uid);
+ if (emfv->displayed_uid == NULL || strcmp(emfv->displayed_uid, uid) != 0) {
+ g_free(emfv->displayed_uid);
+ emfv->displayed_uid = g_strdup(uid);
mail_get_message(emfv->folder, uid, emfv_list_done_message_selected, emfv, mail_thread_new);
}
} else {
- g_free(emfv->priv->displayed_uid);
- emfv->priv->displayed_uid = NULL;
+ g_free(emfv->displayed_uid);
+ emfv->displayed_uid = NULL;
em_format_format((EMFormat *)emfv->preview, NULL, NULL, NULL);
}
}
diff --git a/mail/em-folder-view.h b/mail/em-folder-view.h
index 96c7ad97d0..aca9ef86e3 100644
--- a/mail/em-folder-view.h
+++ b/mail/em-folder-view.h
@@ -64,6 +64,8 @@ struct _EMFolderView {
struct _CamelFolder *folder;
char *folder_uri;
+ char *displayed_uid; /* only used to stop re-loads, don't use it to represent any selection state */
+
/* used to load ui from base activate implementation */
GSList *ui_files; /* const char * list, TODO: should this be on class? */
const char *ui_app_name;
diff --git a/mail/em-migrate.c b/mail/em-migrate.c
index 44286f8739..533228d2e3 100644
--- a/mail/em-migrate.c
+++ b/mail/em-migrate.c
@@ -54,6 +54,7 @@
#include "mail-component.h" /* for em_uri_from_camel() */
#include "em-migrate.h"
+#include "mail-vfolder.h"
#define d(x) x
@@ -1990,6 +1991,7 @@ em_migrate (const char *evolution_dir, int major, int minor, int revision, Camel
if (vfolders) {
emm_save_xml (vfolders, path, "vfolders.xml");
xmlFreeDoc (vfolders);
+ vfolder_revert();
}
g_free (path);
diff --git a/mail/mail-component.c b/mail/mail-component.c
index 749fcbc3eb..ad6b728ad6 100644
--- a/mail/mail-component.c
+++ b/mail/mail-component.c
@@ -481,17 +481,21 @@ impl_upgradeFromVersion (PortableServer_Servant servant, short major, short mino
{
MailComponent *component;
CamelException ex;
-
+ int ok;
+
component = mail_component_peek ();
camel_exception_init (&ex);
- if (em_migrate (component->priv->base_directory, major, minor, revision, &ex) == -1) {
- /* FIXME: report errors? */
- camel_exception_clear (&ex);
- return FALSE;
- }
-
- return TRUE;
+ ok = em_migrate (component->priv->base_directory, major, minor, revision, &ex) != -1;
+
+ /* FIXME: report errors? */
+ camel_exception_clear (&ex);
+
+ /* This is a hack so that after importing new folders, they properly hook into vfolders, etc.
+ Perhaps the CamelLocalStore class should emit folder_created events for folders when opened */
+ mail_note_store(component->priv->local_store, NULL, NULL, NULL);
+
+ return ok;
}
/* Initialization. */
@@ -532,7 +536,6 @@ mail_component_init (MailComponent *component)
priv->activity_handler = e_activity_handler_new ();
- /* EPFIXME: Turn into an object? */
mail_session_init (priv->base_directory);
priv->async_event = mail_async_event_new();
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c
index b1474b7afe..fc0e502c8f 100644
--- a/mail/mail-vfolder.c
+++ b/mail/mail-vfolder.c
@@ -850,6 +850,17 @@ vfolder_load_storage(void)
g_free(storeuri);
}
+void
+vfolder_revert(void)
+{
+ char *user;
+
+ d(printf("vfolder_revert\n"));
+ user = g_strdup_printf("%s/mail/vfolders.xml", mail_component_peek_base_directory (mail_component_peek ()));
+ rule_context_revert((RuleContext *)context, user);
+ g_free(user);
+}
+
static GtkWidget *vfolder_editor = NULL;
static void
diff --git a/mail/mail-vfolder.h b/mail/mail-vfolder.h
index d945454c5e..f7fc684e56 100644
--- a/mail/mail-vfolder.h
+++ b/mail/mail-vfolder.h
@@ -10,6 +10,7 @@
#include "filter/filter-part.h"
void vfolder_load_storage(void);
+void vfolder_revert(void);
void vfolder_edit (void);
void vfolder_edit_rule(const char *name);