diff options
author | Peter Williams <peterw@ximian.com> | 2002-08-10 03:37:31 +0800 |
---|---|---|
committer | Peter Williams <peterw@src.gnome.org> | 2002-08-10 03:37:31 +0800 |
commit | 56ddb4490bb634e033c3efc1bc20170d2edfcc95 (patch) | |
tree | 755f6ea1ff9709b48d50505c9c3a4439d74b51c0 /camel/providers | |
parent | d6c5e8db0d5d179a552cde5f7add078a70d521d6 (diff) | |
download | gsoc2013-evolution-56ddb4490bb634e033c3efc1bc20170d2edfcc95.tar.gz gsoc2013-evolution-56ddb4490bb634e033c3efc1bc20170d2edfcc95.tar.zst gsoc2013-evolution-56ddb4490bb634e033c3efc1bc20170d2edfcc95.zip |
Tweak how we build the tree based on whether a full tree or a subtree is
2002-08-09 Peter Williams <peterw@ximian.com>
* providers/imap/camel-imap-store.c
(get_folder_info_online): Tweak how we build the tree based on whether
a full tree or a subtree is being requested. Fixes subscribe dialog
on UW servers.
(get_one_folder_offline): Don't add folders that we're not subscribed
to; fixes UW folders that weren't being marked as NoSelect because
the storeinfo doesn't record that information.
svn path=/trunk/; revision=17755
Diffstat (limited to 'camel/providers')
-rw-r--r-- | camel/providers/imap/camel-imap-store.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index aa423dc711..7373df146b 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -2098,7 +2098,18 @@ get_folder_info_online (CamelStore *store, const char *top, } /* Assemble. */ - tree = camel_folder_info_build (folders, name, imap_store->dir_sep, TRUE); + + /* if building the folder tree, preserve the namespace at the top. Note the + * ==, not strcmp. This makes it so that the subscribe dialog and the folder + * tree have the same layout and prevents the subscribe dialog from building + * infinitely large trees. + */ + + if (name == imap_store->namespace) + tree = camel_folder_info_build (folders, "", imap_store->dir_sep, TRUE); + else + tree = camel_folder_info_build (folders, name, imap_store->dir_sep, TRUE); + if (flags & CAMEL_STORE_FOLDER_INFO_FAST) { g_ptr_array_free (folders, TRUE); return tree; @@ -2167,6 +2178,15 @@ get_one_folder_offline (const char *physical_path, const char *path, gpointer da if (*path != '/') return TRUE; + /* folder_info_build will insert parent nodes as necessary and mark + * them as noselect, which is information we actually don't have at + * the moment. So let it do the right thing by bailing out if it's + * not a folder we're explicitly interested in. + */ + + if (g_hash_table_lookup (imap_store->subscribed_folders, path + 1) == 0) + return TRUE; + fi = g_new0 (CamelFolderInfo, 1); fi->full_name = g_strdup (path+1); fi->name = strrchr (fi->full_name, imap_store->dir_sep); |