evolution-exchange r1614 - in trunk: . camel mail



Author: msuman
Date: Mon Mar 17 04:07:26 2008
New Revision: 1614
URL: http://svn.gnome.org/viewvc/evolution-exchange?rev=1614&view=rev

Log:
Patch from Bharath Acharya  <abharath novell com> ** Fix for bug #520676 (Use special icons for 'Sent Items' and 'Deleted Items' folders)

Modified:
   trunk/ChangeLog
   trunk/camel/camel-exchange-store.c
   trunk/camel/camel-stub-constants.h
   trunk/mail/mail-stub-exchange.c
   trunk/mail/mail-stub-exchange.h

Modified: trunk/camel/camel-exchange-store.c
==============================================================================
--- trunk/camel/camel-exchange-store.c	(original)
+++ trunk/camel/camel-exchange-store.c	Mon Mar 17 04:07:26 2008
@@ -662,6 +662,12 @@
 
 	if (flags & CAMEL_STUB_FOLDER_TYPE_INBOX)
 		info->flags |= CAMEL_FOLDER_TYPE_INBOX;
+	
+	if (flags & CAMEL_STUB_FOLDER_TYPE_TRASH)
+		info->flags |= CAMEL_FOLDER_TYPE_TRASH;
+
+	if (flags & CAMEL_STUB_FOLDER_TYPE_SENT)
+		info->flags |= CAMEL_FOLDER_TYPE_SENT;
 
 	if (flags & CAMEL_STUB_FOLDER_SUBSCRIBED) {
 		info->flags |= CAMEL_FOLDER_SUBSCRIBED;

Modified: trunk/camel/camel-stub-constants.h
==============================================================================
--- trunk/camel/camel-stub-constants.h	(original)
+++ trunk/camel/camel-stub-constants.h	Mon Mar 17 04:07:26 2008
@@ -79,7 +79,9 @@
 	CAMEL_STUB_FOLDER_SYSTEM      = (1<<6),
 	CAMEL_STUB_FOLDER_TYPE_INBOX  = (1<<7),
 	CAMEL_STUB_FOLDER_SUBSCRIBED  = (1<<8),
-	CAMEL_STUB_FOLDER_NOCHILDREN  = (1<<9)
+	CAMEL_STUB_FOLDER_NOCHILDREN  = (1<<9),
+	CAMEL_STUB_FOLDER_TYPE_TRASH  = (1<<10),
+	CAMEL_STUB_FOLDER_TYPE_SENT   = (1<<11)
 } CamelStubFolderFlags;
 
 typedef enum {

Modified: trunk/mail/mail-stub-exchange.c
==============================================================================
--- trunk/mail/mail-stub-exchange.c	(original)
+++ trunk/mail/mail-stub-exchange.c	Mon Mar 17 04:07:26 2008
@@ -2727,7 +2727,7 @@
 	GArray *unread, *flags;
 	ExchangeHierarchy *hier;
 	EFolder *folder;
-	const char *type, *name, *uri, *path, *inbox_uri = NULL;
+	const char *type, *name, *uri, *path, *inbox_uri = NULL, *trash_uri = NULL, *sent_items_uri = NULL;
 	int unread_count, i, toplen = top ? strlen (top) : 0;
 	guint32 folder_flags = 0;
 	gboolean recursive, subscribed, info_fast;
@@ -2773,6 +2773,14 @@
 		inbox_uri = e_folder_get_physical_uri (mse->inbox);
 	}
 
+	if (mse->deleted_items) {
+		trash_uri = e_folder_get_physical_uri (mse->deleted_items);
+	}
+
+	if (mse->sent_items) {
+		sent_items_uri = e_folder_get_physical_uri (mse->sent_items);
+	}
+
 	if (folders) {
 		for (i = 0; i < folders->len; i++) {
 			folder = folders->pdata[i];
@@ -2846,6 +2854,12 @@
 			if (inbox_uri && !strcmp (uri, inbox_uri))
 				folder_flags |= CAMEL_STUB_FOLDER_SYSTEM|CAMEL_STUB_FOLDER_TYPE_INBOX;
 
+			if (trash_uri && !strcmp (uri, trash_uri))
+				folder_flags |= CAMEL_STUB_FOLDER_SYSTEM|CAMEL_STUB_FOLDER_TYPE_TRASH;
+
+			if (sent_items_uri && !strcmp (uri, sent_items_uri))
+				folder_flags |= CAMEL_STUB_FOLDER_SYSTEM|CAMEL_STUB_FOLDER_TYPE_SENT;
+
 			if (!e_folder_exchange_get_has_subfolders (folder)) {
 				d(printf ("%s:%d:%s - %s has no subfolders", __FILE__, __LINE__, __GNUC_PRETTY_FUNCTION__,
 					  name));
@@ -3292,6 +3306,8 @@
 	mse->inbox = exchange_account_get_folder (account, uri);
 	uri = exchange_account_get_standard_uri (account, "deleteditems");
 	mse->deleted_items = exchange_account_get_folder (account, uri);
+	uri = exchange_account_get_standard_uri (account, "sentitems");
+	mse->sent_items = exchange_account_get_folder (account, uri);
 
 	/* Will be used for offline->online transition to initialize things for
 	   the first time */

Modified: trunk/mail/mail-stub-exchange.h
==============================================================================
--- trunk/mail/mail-stub-exchange.h	(original)
+++ trunk/mail/mail-stub-exchange.h	Mon Mar 17 04:07:26 2008
@@ -28,7 +28,7 @@
 	E2kContext *ctx;
 	GHashTable *folders_by_name;
 	const char *mail_submission_uri;
-	EFolder *inbox, *deleted_items;
+	EFolder *inbox, *deleted_items, *sent_items;
 
 	guint new_folder_id, removed_folder_id;
 	const char *ignore_new_folder, *ignore_removed_folder;



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