[evolution-data-server] Bug #661743 - Return maildir Inbox sibling folders only when requested



commit e2c308cf247486435f7832518dc0973b5c60a4d2
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jan 2 19:22:19 2012 +0100

    Bug #661743 - Return maildir Inbox sibling folders only when requested

 camel/providers/local/camel-maildir-store.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/camel/providers/local/camel-maildir-store.c b/camel/providers/local/camel-maildir-store.c
index 920cfdc..03b0925 100644
--- a/camel/providers/local/camel-maildir-store.c
+++ b/camel/providers/local/camel-maildir-store.c
@@ -523,6 +523,7 @@ maildir_dir_name_to_fullname (const gchar *dir_name)
 static gint
 scan_dirs (CamelStore *store,
            guint32 flags,
+	   gboolean can_inbox_sibling,
            CamelFolderInfo **topfi,
            GCancellable *cancellable,
            GError **error)
@@ -593,9 +594,11 @@ scan_dirs (CamelStore *store,
 		else
 			short_name++;
 
-		if (g_ascii_strcasecmp ((*topfi)->full_name, "Inbox") != 0 
-					&& !g_str_has_prefix (full_name, (*topfi)->full_name)) {
-
+		if ((g_ascii_strcasecmp ((*topfi)->full_name, "Inbox") != 0 
+		    && !g_str_has_prefix (full_name, (*topfi)->full_name))
+		    || (!can_inbox_sibling
+		    && g_ascii_strcasecmp ((*topfi)->full_name, "Inbox") == 0 
+		    && !g_str_has_prefix (full_name, (*topfi)->full_name))) {
 			g_free (full_name);
 			continue;
 		}
@@ -656,7 +659,7 @@ maildir_store_get_folder_info_sync (CamelStore *store,
 	if (top == NULL || top[0] == 0) {
 		/* create a dummy "." parent inbox, use to scan, then put back at the top level */
 		fi = scan_fi(store, flags, "Inbox", _("Inbox"), cancellable);
-		if (scan_dirs (store, flags, &fi, cancellable, error) == -1)
+		if (scan_dirs (store, flags, TRUE, &fi, cancellable, error) == -1)
 			goto fail;
 
 		fi->flags |= CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_TYPE_INBOX;
@@ -669,7 +672,7 @@ maildir_store_get_folder_info_sync (CamelStore *store,
 		fi = scan_fi (store, flags, top, name ? name + 1 : top, cancellable);
 		if (g_strcmp0 (fi->full_name, CAMEL_VTRASH_NAME) != 0 &&
 		    g_strcmp0 (fi->full_name, CAMEL_VJUNK_NAME) != 0 &&
-		    scan_dirs (store, flags, &fi, cancellable, error) == -1)
+		    scan_dirs (store, flags, FALSE, &fi, cancellable, error) == -1)
 			goto fail;
 	}
 



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