aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-05-07 14:48:38 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-05-07 14:48:38 +0800
commit27176351ae38247a7b7c656e73727d704b12c63e (patch)
tree1ef7b1d5d6dba2fc33803dc1c512d654a4b5225a
parent3fcf0b4edc4e1a95ceae5693bd7a65690c3251f6 (diff)
downloadgsoc2013-evolution-27176351ae38247a7b7c656e73727d704b12c63e.tar.gz
gsoc2013-evolution-27176351ae38247a7b7c656e73727d704b12c63e.tar.zst
gsoc2013-evolution-27176351ae38247a7b7c656e73727d704b12c63e.zip
** See bug #57935.
2004-05-07 Not Zed <NotZed@Ximian.com> ** See bug #57935. * em-folder-view.c (emfv_set_message): add new arg, nomarkseen, don't mark the selected message seen once its loaded. (emfv_list_message_selected): clear the nomarkseen flag once we've processed the selection. (emfv_list_done_message_selected): handle the nomarkseen flag, don't mark a message seen if it was explictly selected. * em-folder-browser.c (emfb_list_built): use em_folder_view_select_message rather than doing it via the messagelist directly. svn path=/trunk/; revision=25821
-rw-r--r--mail/ChangeLog13
-rw-r--r--mail/em-folder-browser.c4
-rw-r--r--mail/em-folder-view.c16
-rw-r--r--mail/em-folder-view.h4
-rw-r--r--mail/em-message-browser.c9
5 files changed, 33 insertions, 13 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 249dfa3f06..11c5599535 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,18 @@
2004-05-07 Not Zed <NotZed@Ximian.com>
+ ** See bug #57935.
+
+ * em-folder-view.c (emfv_set_message): add new arg, nomarkseen,
+ don't mark the selected message seen once its loaded.
+ (emfv_list_message_selected): clear the nomarkseen flag once we've
+ processed the selection.
+ (emfv_list_done_message_selected): handle the nomarkseen flag,
+ don't mark a message seen if it was explictly selected.
+
+ * em-folder-browser.c (emfb_list_built): use
+ em_folder_view_select_message rather than doing it via the
+ messagelist directly.
+
** Dunno why i bothered, but see bug #58090.
* importers/netscape-importer.c
diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c
index 4a208c7906..df15cb9230 100644
--- a/mail/em-folder-browser.c
+++ b/mail/em-folder-browser.c
@@ -313,7 +313,7 @@ void em_folder_browser_show_preview(EMFolderBrowser *emfb, gboolean state)
char *uid = g_alloca(strlen(emfb->view.list->cursor_uid)+1);
strcpy(uid, emfb->view.list->cursor_uid);
- em_folder_view_set_message(&emfb->view, uid);
+ em_folder_view_set_message(&emfb->view, uid, TRUE);
}
/* need to load/show the current message? */
@@ -839,7 +839,7 @@ emfb_list_built (MessageList *ml, EMFolderBrowser *emfb)
if (emfv->list->cursor_uid == NULL) {
if (emfb->priv->select_uid) {
- message_list_select_uid (ml, emfb->priv->select_uid);
+ em_folder_view_set_message(emfv, emfb->priv->select_uid, TRUE);
g_free (emfb->priv->select_uid);
emfb->priv->select_uid = NULL;
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index 09ba0c6360..cb55b049fc 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -104,7 +104,7 @@ static void emfv_enable_menus(EMFolderView *emfv);
static void emfv_set_folder(EMFolderView *emfv, CamelFolder *folder, const char *uri);
static void emfv_set_folder_uri(EMFolderView *emfv, const char *uri);
-static void emfv_set_message(EMFolderView *emfv, const char *uid);
+static void emfv_set_message(EMFolderView *emfv, const char *uid, int nomarkseen);
static void emfv_activate(EMFolderView *emfv, BonoboUIComponent *uic, int state);
static void emfv_message_reply(EMFolderView *emfv, int mode);
@@ -121,7 +121,8 @@ static const EMFolderViewEnable emfv_enable_map[];
struct _EMFolderViewPrivate {
guint seen_id;
guint setting_notify_id;
-
+ int nomarkseen:1;
+
CamelObjectHookID folder_changed_id;
GtkWidget *invisible;
@@ -366,7 +367,7 @@ em_folder_view_open_selected(EMFolderView *emfv)
/* FIXME: session needs to be passed easier than this */
em_format_set_session((EMFormat *)((EMFolderView *)emmb)->preview, ((EMFormat *)emfv->preview)->session);
em_folder_view_set_folder((EMFolderView *)emmb, emfv->folder, emfv->folder_uri);
- em_folder_view_set_message((EMFolderView *)emmb, uids->pdata[i]);
+ em_folder_view_set_message((EMFolderView *)emmb, uids->pdata[i], FALSE);
gtk_widget_show(emmb->window);
}
@@ -529,8 +530,10 @@ emfv_set_folder_uri(EMFolderView *emfv, const char *uri)
}
static void
-emfv_set_message(EMFolderView *emfv, const char *uid)
+emfv_set_message(EMFolderView *emfv, const char *uid, int nomarkseen)
{
+ /* This could possible race with other set messages, but likelyhood is small */
+ emfv->priv->nomarkseen = nomarkseen;
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);
@@ -1886,6 +1889,7 @@ emfv_list_done_message_selected(CamelFolder *folder, const char *uid, CamelMimeM
EMFolderView *emfv = data;
if (emfv->preview == NULL) {
+ emfv->priv->nomarkseen = FALSE;
g_object_unref (emfv);
return;
}
@@ -1895,7 +1899,7 @@ emfv_list_done_message_selected(CamelFolder *folder, const char *uid, CamelMimeM
if (emfv->priv->seen_id)
g_source_remove(emfv->priv->seen_id);
- if (msg && emfv->mark_seen) {
+ if (msg && emfv->mark_seen && !emfv->priv->nomarkseen) {
if (emfv->mark_seen_timeout > 0) {
struct mst_t *mst;
@@ -1911,6 +1915,7 @@ emfv_list_done_message_selected(CamelFolder *folder, const char *uid, CamelMimeM
}
g_object_unref (emfv);
+ emfv->priv->nomarkseen = FALSE;
}
static void
@@ -1929,6 +1934,7 @@ emfv_list_message_selected(MessageList *ml, const char *uid, EMFolderView *emfv)
g_free(emfv->displayed_uid);
emfv->displayed_uid = NULL;
em_format_format((EMFormat *)emfv->preview, NULL, NULL, NULL);
+ emfv->priv->nomarkseen = FALSE;
}
}
diff --git a/mail/em-folder-view.h b/mail/em-folder-view.h
index 4918814e4b..4a84eadf33 100644
--- a/mail/em-folder-view.h
+++ b/mail/em-folder-view.h
@@ -102,7 +102,7 @@ struct _EMFolderViewClass {
void (*set_folder_uri)(EMFolderView *emfv, const char *uri);
void (*set_folder)(EMFolderView *emfv, struct _CamelFolder *folder, const char *uri);
- void (*set_message)(EMFolderView *emfv, const char *uid);
+ void (*set_message)(EMFolderView *emfv, const char *uid, int nomarkseen);
/* Signals */
void (*on_url)(EMFolderView *emfv, const char *uri, const char *nice_uri);
@@ -118,7 +118,7 @@ GtkWidget *em_folder_view_new(void);
#define em_folder_view_activate(emfv, uic, state) EM_FOLDER_VIEW_GET_CLASS (emfv)->activate((emfv), (uic), (state))
#define em_folder_view_set_folder(emfv, folder, uri) EM_FOLDER_VIEW_GET_CLASS (emfv)->set_folder((emfv), (folder), (uri))
#define em_folder_view_set_folder_uri(emfv, uri) EM_FOLDER_VIEW_GET_CLASS (emfv)->set_folder_uri((emfv), (uri))
-#define em_folder_view_set_message(emfv, uid) EM_FOLDER_VIEW_GET_CLASS (emfv)->set_message((emfv), (uid))
+#define em_folder_view_set_message(emfv, uid, nomarkseen) EM_FOLDER_VIEW_GET_CLASS (emfv)->set_message((emfv), (uid), (nomarkseen))
struct _EMPopupTarget *em_folder_view_get_popup_target(EMFolderView *emfv);
diff --git a/mail/em-message-browser.c b/mail/em-message-browser.c
index 9ddbae1327..63517d38d2 100644
--- a/mail/em-message-browser.c
+++ b/mail/em-message-browser.c
@@ -52,7 +52,7 @@ struct _EMMessageBrowserPrivate {
GtkWidget *preview; /* container for message display */
};
-static void emmb_set_message(EMFolderView *emfv, const char *uid);
+static void emmb_set_message(EMFolderView *emfv, const char *uid, int nomarkseen);
static void emmb_activate(EMFolderView *emfv, BonoboUIComponent *uic, int state);
static EMFolderViewClass *emmb_parent;
@@ -230,12 +230,12 @@ GtkWidget *em_message_browser_window_new(void)
/* ********************************************************************** */
static void
-emmb_set_message(EMFolderView *emfv, const char *uid)
+emmb_set_message(EMFolderView *emfv, const char *uid, int nomarkseen)
{
EMMessageBrowser *emmb = (EMMessageBrowser *) emfv;
CamelMessageInfo *info;
- emmb_parent->set_message(emfv, uid);
+ emmb_parent->set_message(emfv, uid, nomarkseen);
if (uid == NULL)
return;
@@ -246,7 +246,8 @@ emmb_set_message(EMFolderView *emfv, const char *uid)
}
/* Well we don't know if it got displayed (yet) ... but whatever ... */
- camel_folder_set_message_flags(emfv->folder, uid, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
+ if (!nomarkseen)
+ camel_folder_set_message_flags(emfv->folder, uid, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
}
static void