diff options
author | Jeffrey Stedfast <fejj@helixcode.com> | 2000-07-20 02:15:37 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-07-20 02:15:37 +0800 |
commit | f86da998ff2ef6ee67a7825ddd73c0298a0956ae (patch) | |
tree | 4f36cfe5cec112315c4d8483f17012e6d622d262 /camel/providers | |
parent | a273803fab7a94128cc6cd8fc780827c2b5c1364 (diff) | |
download | gsoc2013-evolution-f86da998ff2ef6ee67a7825ddd73c0298a0956ae.tar.gz gsoc2013-evolution-f86da998ff2ef6ee67a7825ddd73c0298a0956ae.tar.zst gsoc2013-evolution-f86da998ff2ef6ee67a7825ddd73c0298a0956ae.zip |
If the folder's message count is not the same as the number of summaries,
2000-07-19 Jeffrey Stedfast <fejj@helixcode.com>
* providers/imap/camel-imap-folder.c (imap_get_summary): If the folder's
message count is not the same as the number of summaries, free the old
summary and create a new summary.
svn path=/trunk/; revision=4223
Diffstat (limited to 'camel/providers')
-rw-r--r-- | camel/providers/imap/camel-imap-folder.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index f5235c5a30..bf0f1ff03b 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -189,16 +189,12 @@ camel_imap_folder_new (CamelStore *parent, char *folder_name, CamelException *ex return folder; } -static void -imap_finalize (GtkObject *object) +static void +imap_summary_free (CamelImapFolder *imap_folder) { - /* TODO: do we need to do more here? */ - CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (object); CamelMessageInfo *info; gint i, max; - GTK_OBJECT_CLASS (parent_class)->finalize (object); - g_return_if_fail (imap_folder->summary != NULL); max = imap_folder->summary->len; @@ -219,6 +215,15 @@ imap_finalize (GtkObject *object) imap_folder->summary = NULL; } +static void +imap_finalize (GtkObject *object) +{ + /* TODO: do we need to do more here? */ + CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (object); + + imap_summary_free (imap_folder); +} + static void imap_init (CamelFolder *folder, CamelStore *parent_store, CamelFolder *parent_folder, const gchar *name, gchar *separator, gboolean path_begins_with_sep, CamelException *ex) @@ -1059,7 +1064,7 @@ static char *header_fields[] = { "subject", "from", "to", "cc", "date", a2 OK FETCH completed */ -GPtrArray * +static GPtrArray * imap_get_summary (CamelFolder *folder, CamelException *ex) { CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder); @@ -1069,10 +1074,16 @@ imap_get_summary (CamelFolder *folder, CamelException *ex) const char *received; struct _header_raw *h, *tail = NULL; - if (imap_folder->summary) - return imap_folder->summary; + /*if (imap_folder->summary) + return imap_folder->summary;*/ num = imap_get_message_count (folder, ex); + + if (imap_folder->summary && imap_folder->summary->len == num) + return imap_folder->summary; + + /* clean up any previous summary data */ + imap_summary_free (imap_folder); summary = g_ptr_array_new (); |