aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-tree-model.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-03-03 14:39:14 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-03-03 14:39:14 +0800
commit467bbf6fb6b0b215d7b6bd18a6b84acd839a08f9 (patch)
tree9bb0cb5e2fb74fbea57f5dfd818a4769349f8990 /mail/em-folder-tree-model.c
parent9b2a16eb3e313e3057a8ac785fecacf54c8266a0 (diff)
downloadgsoc2013-evolution-467bbf6fb6b0b215d7b6bd18a6b84acd839a08f9.tar
gsoc2013-evolution-467bbf6fb6b0b215d7b6bd18a6b84acd839a08f9.tar.gz
gsoc2013-evolution-467bbf6fb6b0b215d7b6bd18a6b84acd839a08f9.tar.bz2
gsoc2013-evolution-467bbf6fb6b0b215d7b6bd18a6b84acd839a08f9.tar.lz
gsoc2013-evolution-467bbf6fb6b0b215d7b6bd18a6b84acd839a08f9.tar.xz
gsoc2013-evolution-467bbf6fb6b0b215d7b6bd18a6b84acd839a08f9.tar.zst
gsoc2013-evolution-467bbf6fb6b0b215d7b6bd18a6b84acd839a08f9.zip
if we have the folder opened already, and its the outbox, then use the
2004-03-03 Not Zed <NotZed@Ximian.com> * em-inline-filter.c (emif_scan): * em-folder-tree-model.c (em_folder_tree_model_set_folder_info): if we have the folder opened already, and its the outbox, then use the total count instead of unread count. Bit of hack, but copies mail-folder-cache stuff. * mail-component.c (mc_add_store): renamed from mail_component_add_store, internal call. Added a done callback. (mc_add_local_store): renamed from mc_add_store, callback for local store. (mail_component_add_store): call mc_add_store to do the work. (mc_add_local_store_done): ugh, the target of all this shit - note all the default folders now they should be setup. * mail-folder-cache.c (mail_note_folder): clean up the logic a bit. was gonna do osmething else but it didn't work. 2004-03-02 Not Zed <NotZed@Ximian.com> * mail-send-recv.c (mail_send): if we're already sending, up the again count to tell it we need to re-send again. (receive_done): if we've been asked to run a send again while we were already running it, run it again to make sure we didn't miss any new messages. See bug #46839. * em-mailer-prefs.c (em_mailer_prefs_construct): update check_incoming_imap changes for merge conflicts. (settings_changed): i have no idea what these changes jeff did do, but check_incoming_imap is no longer needed, so i've deleted most of it. 2004-02-27 Not Zed <NotZed@Ximian.com> * em-format.c (emf_multipart_encrypted, emf_multipart_signed): If validation fails, display as multipart/mixed rather than unkown attachment type, and make the error a little clearer that its an error. See #52939. 2004-02-26 Not Zed <NotZed@Ximian.com> * message-list.c (regen_list_regened): NOOP if the folder has changed. * mail-session.c (mail_session_check_junk_notify): remove check_incoming_imap test. (mail_session_init): " * evolution-mail.schemas.in.in: Remove check_incoming_imap option. * mail-config.glade: Remove check incoming imap checkbox. * em-mailer-prefs.c (em_mailer_prefs_construct): remove check_incoming_imap test. (em_mailer_prefs_apply): " (settings_changed): " svn path=/trunk/; revision=24944
Diffstat (limited to 'mail/em-folder-tree-model.c')
-rw-r--r--mail/em-folder-tree-model.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index 91defd775b..948de7774a 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -41,12 +41,16 @@
#include "mail-tools.h"
#include "mail-mt.h"
+/* sigh, these 2 only needed for outbox total count checking - a mess */
+#include "mail-component.h"
+#include "mail-folder-cache.h"
+
#include "em-utils.h"
#include "em-marshal.h"
#include "em-folder-tree-model.h"
-
+#define u(x) /* unread count debug */
#define d(x) x
static GType col_types[] = {
@@ -408,6 +412,7 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *ite
GtkTreePath *path;
GtkTreeIter sub;
gboolean load;
+ struct _CamelFolder *folder;
load = fi->child == NULL && !(fi->flags & (CAMEL_FOLDER_NOCHILDREN | CAMEL_FOLDER_NOINFERIORS));
@@ -415,12 +420,19 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *ite
uri_row = gtk_tree_row_reference_new ((GtkTreeModel *) model, path);
path_row = gtk_tree_row_reference_copy (uri_row);
gtk_tree_path_free (path);
-
+
g_hash_table_insert (model->uri_hash, g_strdup (fi->url), uri_row);
g_hash_table_insert (si->path_hash, g_strdup (fi->path), path_row);
-
+
+ /* HACK: if we have the folder, and its the outbox folder, we need the total count, not unread */
+ /* This is duplicated in mail-folder-cache too, should perhaps be functionised */
unread = fi->unread_message_count == -1 ? 0 : fi->unread_message_count;
-
+ if (mail_note_get_folder_from_uri(fi->url, &folder) && folder) {
+ if (folder == mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_OUTBOX))
+ unread = camel_folder_get_message_count(folder);
+ camel_object_unref(folder);
+ }
+
gtk_tree_store_set ((GtkTreeStore *) model, iter,
COL_STRING_DISPLAY_NAME, fi->name,
COL_POINTER_CAMEL_STORE, si->store,
@@ -939,14 +951,20 @@ em_folder_tree_model_set_unread_count (EMFolderTreeModel *model, CamelStore *sto
g_return_if_fail (CAMEL_IS_STORE (store));
g_return_if_fail (path != NULL);
+ u(printf("set unread count %p '%s' %d\n", store, path, unread));
+
if (unread < 0)
unread = 0;
- if (!(si = g_hash_table_lookup (model->store_hash, store)))
+ if (!(si = g_hash_table_lookup (model->store_hash, store))) {
+ u(printf(" can't find store\n"));
return;
+ }
- if (!(row = g_hash_table_lookup (si->path_hash, path)))
+ if (!(row = g_hash_table_lookup (si->path_hash, path))) {
+ u(printf(" can't find row\n"));
return;
+ }
tree_path = gtk_tree_row_reference_get_path (row);
if (!gtk_tree_model_get_iter ((GtkTreeModel *) model, &iter, tree_path)) {