aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-properties.c
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 /mail/em-folder-properties.c
parentd0ecf4969e7ef2d79e6b718db1929125f5e4bbb8 (diff)
downloadgsoc2013-evolution-24ac71c6a0ba23414aeb76e877fd10949e2181b9.tar.gz
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
Diffstat (limited to 'mail/em-folder-properties.c')
-rw-r--r--mail/em-folder-properties.c33
1 files changed, 30 insertions, 3 deletions
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")