aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeerapuram Varadhan <vvaradan@src.gnome.org>2006-02-23 21:26:41 +0800
committerVeerapuram Varadhan <vvaradan@src.gnome.org>2006-02-23 21:26:41 +0800
commit24ac71c6a0ba23414aeb76e877fd10949e2181b9 (patch)
tree412fbe5c30ac4129cbc9ba91a7c2b8d7826c4901
parentd0ecf4969e7ef2d79e6b718db1929125f5e4bbb8 (diff)
downloadgsoc2013-evolution-24ac71c6a0ba23414aeb76e877fd10949e2181b9.tar
gsoc2013-evolution-24ac71c6a0ba23414aeb76e877fd10949e2181b9.tar.gz
gsoc2013-evolution-24ac71c6a0ba23414aeb76e877fd10949e2181b9.tar.bz2
gsoc2013-evolution-24ac71c6a0ba23414aeb76e877fd10949e2181b9.tar.lz
gsoc2013-evolution-24ac71c6a0ba23414aeb76e877fd10949e2181b9.tar.xz
gsoc2013-evolution-24ac71c6a0ba23414aeb76e877fd10949e2181b9.tar.zst
gsoc2013-evolution-24ac71c6a0ba23414aeb76e877fd10949e2181b9.zip
** Fixes bug #329733
* em-folder-properties.c (emfp_dialog_got_folder): Fetch both VISIBLE and DELETED count from the folder and adjust it according before showing it in the properties dialog w.r.t user preferences. svn path=/trunk/; revision=31568
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/em-folder-properties.c33
2 files changed, 38 insertions, 3 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 8557f84af0..82a9f401f5 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,11 @@
+2006-02-21 Veerapuram Varadhan <vvaradhan@novell.com>
+
+ ** Fixes bug #329733
+
+ * em-folder-properties.c (emfp_dialog_got_folder): Fetch both
+ VISIBLE and DELETED count from the folder and adjust it according
+ before showing it in the properties dialog w.r.t user preferences.
+
2006-02-21 Tor Lillqvist <tml@novell.com>
* em-composer-utils.c: Use the same Win32 macro for gmtime_r()
diff --git a/mail/em-folder-properties.c b/mail/em-folder-properties.c
index 98ada5a740..3b7fe1244e 100644
--- a/mail/em-folder-properties.c
+++ b/mail/em-folder-properties.c
@@ -38,7 +38,11 @@
#include <gtk/gtktogglebutton.h>
#include <gtk/gtkvbox.h>
+#include <gconf/gconf-client.h>
+
+#include <camel/camel-store.h>
#include <camel/camel-folder.h>
+#include <camel/camel-vtrash-folder.h>
#include <camel/camel-vee-folder.h>
#include <libgnome/gnome-i18n.h>
@@ -49,6 +53,7 @@
#include "mail-ops.h"
#include "mail-mt.h"
#include "mail-vfolder.h"
+#include "mail-config.h"
struct _prop_data {
void *object;
@@ -226,23 +231,45 @@ emfp_dialog_got_folder (char *uri, CamelFolder *folder, void *data)
GtkWidget *dialog, *w;
struct _prop_data *prop_data;
GSList *l;
- gint32 count, i;
+ gint32 count, i,deleted;
EMConfig *ec;
EMConfigTargetFolder *target;
CamelArgGetV *arggetv;
CamelArgV *argv;
+ gboolean hide_deleted;
+ GConfClient *gconf;
+ CamelStore *store;
if (folder == NULL)
return;
+ store = folder->parent_store;
+
prop_data = g_malloc0 (sizeof (*prop_data));
prop_data->object = folder;
camel_object_ref (folder);
+ /*
+ Get number of VISIBLE and DELETED messages, instead of TOTAL messages. VISIBLE+DELETED
+ gives the correct count that matches the label below the Send & Receive button
+ */
camel_object_get (folder, NULL, CAMEL_FOLDER_PROPERTIES, &prop_data->properties, CAMEL_FOLDER_NAME, &prop_data->name,
- CAMEL_FOLDER_TOTAL, &prop_data->total, CAMEL_FOLDER_UNREAD, &prop_data->unread, NULL);
+ CAMEL_FOLDER_VISIBLE, &prop_data->total, CAMEL_FOLDER_UNREAD, &prop_data->unread, CAMEL_FOLDER_DELETED, &deleted, NULL);
+
+ gconf = mail_config_get_gconf_client ();
+ hide_deleted = !gconf_client_get_bool(gconf, "/apps/evolution/mail/display/show_deleted", NULL);
+
+ /*
+ Do the calculation only for those accounts that support VTRASHes
+ */
+ if (store->flags & CAMEL_STORE_VTRASH) {
+ if (CAMEL_IS_VTRASH_FOLDER(folder))
+ prop_data->total += deleted;
+ else if (!hide_deleted && deleted > 0)
+ prop_data->total += deleted;
+ }
- if (folder->parent_store == mail_component_peek_local_store(NULL)
+ if (store == mail_component_peek_local_store(NULL)
&& (!strcmp(prop_data->name, "Drafts")
|| !strcmp(prop_data->name, "Inbox")
|| !strcmp(prop_data->name, "Outbox")