diff options
author | Dan Winship <danw@src.gnome.org> | 2000-10-18 11:03:48 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-10-18 11:03:48 +0800 |
commit | 0ae667a794384246396f2dc903b709e6c6634698 (patch) | |
tree | d1954d1851fb7a20269747ac97b6d1a32a9fe037 | |
parent | bcafa8027f5f7d7f9a513a1109c6ec81bee8f5df (diff) | |
download | gsoc2013-evolution-0ae667a794384246396f2dc903b709e6c6634698.tar gsoc2013-evolution-0ae667a794384246396f2dc903b709e6c6634698.tar.gz gsoc2013-evolution-0ae667a794384246396f2dc903b709e6c6634698.tar.bz2 gsoc2013-evolution-0ae667a794384246396f2dc903b709e6c6634698.tar.lz gsoc2013-evolution-0ae667a794384246396f2dc903b709e6c6634698.tar.xz gsoc2013-evolution-0ae667a794384246396f2dc903b709e6c6634698.tar.zst gsoc2013-evolution-0ae667a794384246396f2dc903b709e6c6634698.zip |
Remove cached info at the end of the summary when the folder shrinks
* providers/imap/camel-imap-folder.c (imap_refresh_info): Remove
cached info at the end of the summary when the folder shrinks
between sessions. Also remove an untrue comment.
* providers/imap/camel-imap-store.c (get_folder): Fix up
summary_file to not include the namespace twice.
svn path=/trunk/; revision=5974
-rw-r--r-- | camel/ChangeLog | 11 | ||||
-rw-r--r-- | camel/providers/imap/camel-imap-folder.c | 21 | ||||
-rw-r--r-- | camel/providers/imap/camel-imap-store.c | 2 |
3 files changed, 23 insertions, 11 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 62ee62055e..9a96178ae7 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,12 @@ +2000-10-17 Dan Winship <danw@helixcode.com> + + * providers/imap/camel-imap-folder.c (imap_refresh_info): Remove + cached info at the end of the summary when the folder shrinks + between sessions. Also remove an untrue comment. + + * providers/imap/camel-imap-store.c (get_folder): Fix up + summary_file to not include the namespace twice. + 2000-10-17 Jeffrey Stedfast <fejj@helixcode.com> * camel-mime-part.c (set_header): Encode the header value. @@ -68,7 +77,6 @@ the possibility of not getting a LIST response back for the top level. ->>>>>>> 1.531 2000-10-12 Dan Winship <danw@helixcode.com> * providers/imap/camel-imap-summary.c: Simple subclass of @@ -118,7 +126,6 @@ (camel-mime-parser.c doesn't use this code because of the MEMPOOL optimization, so nothing was ever actually calling it before.) ->>>>>>> 1.529 2000-10-11 Not Zed <NotZed@HelixCode.com> * camel-mime-part.h (struct _CamelMimePart): Removed diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index fcb6cba5a2..16533dbc1c 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -286,11 +286,9 @@ imap_refresh_info (CamelFolder *folder, CamelException *ex) } } - /* Theoretically, the UIDs could get arbitrarily reordered, - * but that won't normally happen. We assume that if we find a - * UID in the summary that doesn't correspond to the UID in - * the folder, that it means the message was deleted on the - * server, so we remove it from the summary. + /* If we find a UID in the summary that doesn't correspond to + * the UID in the folder, that it means the message was + * deleted on the server, so we remove it from the summary. */ summary_len = camel_folder_summary_count (imap_folder->summary); for (i = 0; i < summary_len && i < imap_folder->exists; i++) { @@ -314,13 +312,20 @@ imap_refresh_info (CamelFolder *folder, CamelException *ex) g_free (new[i].uid); } + /* Remove any leftover cached summary messages. */ + while (summary_len > i + 1) { + camel_folder_summary_remove_index (imap_folder->summary, + --summary_len); + } + + /* Add any new folder messages. */ if (i < imap_folder->exists) { /* Fetch full summary for the remaining messages. */ imap_update_summary (folder, i + 1, imap_folder->exists, ex); - } - for (; i < imap_folder->exists; i++) - g_free (new[i].uid); + while (i < imap_folder->exists) + g_free (new[i++].uid); + } g_free (new); } diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index 6ad48107b1..ae4c13c150 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -448,7 +448,7 @@ get_folder (CamelStore *store, const char *folder_name, gboolean create, CamelEx summary_file = g_strdup_printf ("%s/%s/#summary", imap_store->storage_path, - folder_path); + folder_name); p = strrchr (summary_file, '/'); *p = '\0'; if (e_mkdir_hier (summary_file, S_IRWXU) == 0) { |