[evolution-patches] Fix for http://bugzilla.gnome.org/show_bug.cgi?id=329734



Hi,

Find attached a patch that fixes
http://bugzilla.gnome.org/show_bug.cgi?id=329734

Actually, this patch is derived from the patch by Ranjan Somani
(http://mail.gnome.org/archives/evolution-patches/2006-February/msg00054.html
), but, with little tweaks.

Let me know your comments.

Thanks,

V. Varadhan
? crash-fix.fix
? fix-329734.diff
? mail.error
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3806
diff -u -p -r1.3806 ChangeLog
--- ChangeLog	20 Feb 2006 16:01:00 -0000	1.3806
+++ ChangeLog	20 Feb 2006 19:16:47 -0000
@@ -1,3 +1,11 @@
+2006-02-20  Veerapuram Varadhan <vvaradhan novell com>
+
+	** Fixes bug #329734
+
+	* 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-20  Srinivasa Ragavan <sragavan novell com>
 
 	** Fixes bug #322160 and committed for PRSuman.
Index: em-folder-properties.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-properties.c,v
retrieving revision 1.11
diff -u -p -r1.11 em-folder-properties.c
--- em-folder-properties.c	2 Jan 2006 11:16:00 -0000	1.11
+++ em-folder-properties.c	20 Feb 2006 19:16:47 -0000
@@ -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, Camel
 	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")


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]