aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap/camel-imap-folder.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-06-21 05:11:07 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-06-21 05:11:07 +0800
commit9272361bba93ad292ebd148e3d3ba3a9ea9bd349 (patch)
treef3aacb178e26c2ad70a02e17ddc856523fcaf638 /camel/providers/imap/camel-imap-folder.c
parent8f881bd9d5bf26d3534174fa238030e8026ff749 (diff)
downloadgsoc2013-evolution-9272361bba93ad292ebd148e3d3ba3a9ea9bd349.tar
gsoc2013-evolution-9272361bba93ad292ebd148e3d3ba3a9ea9bd349.tar.gz
gsoc2013-evolution-9272361bba93ad292ebd148e3d3ba3a9ea9bd349.tar.bz2
gsoc2013-evolution-9272361bba93ad292ebd148e3d3ba3a9ea9bd349.tar.lz
gsoc2013-evolution-9272361bba93ad292ebd148e3d3ba3a9ea9bd349.tar.xz
gsoc2013-evolution-9272361bba93ad292ebd148e3d3ba3a9ea9bd349.tar.zst
gsoc2013-evolution-9272361bba93ad292ebd148e3d3ba3a9ea9bd349.zip
Only fetch the summary if the folder summary doesn't already exist. When
2000-06-20 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_summary): Only fetch the summary if the folder summary doesn't already exist. When the summary *does* exist, start fetching from 1, not 0. (imap_free_summary): Don't do anything here. (imap_finalize): Free the summary here instead of in imap_free_summary(). * camel-url.c (check_equal): No need to check s1 if s2 is NULL (camel_url_equal): Don't check the passwd component of the url. and in mail/component-factory.c (create_imap_storage): removal of debug statements mail/folder-browser.c (folder_browser_load_folder): improved imap service parser svn path=/trunk/; revision=3649
Diffstat (limited to 'camel/providers/imap/camel-imap-folder.c')
-rw-r--r--camel/providers/imap/camel-imap-folder.c51
1 files changed, 31 insertions, 20 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 0d67c2fa7f..fd005f82ba 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -209,7 +209,27 @@ static void
imap_finalize (GtkObject *object)
{
/* 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;
+ for (i = 0; i < max; i++) {
+ info = g_ptr_array_index (imap_folder->summary, i);
+ g_free (info->subject);
+ g_free (info->to);
+ g_free (info->from);
+ g_free (info->uid);
+ g_free (info);
+ info = NULL;
+ }
+
+ g_ptr_array_free (imap_folder->summary, TRUE);
+ imap_folder->summary = NULL;
}
static void
@@ -745,16 +765,17 @@ imap_get_summary (CamelFolder *folder, CamelException *ex)
CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
GPtrArray *array = NULL;
CamelMessageInfo *info;
- int i, num, status;
+ gint num, i = 0, status = 0;
char *result, *datestr, *p, *q;
- imap_free_summary (folder, imap_folder->summary);
+ if (imap_folder->summary)
+ return imap_folder->summary;
num = imap_get_message_count (folder, ex);
array = g_ptr_array_new ();
- for (i = 0; i < num; i++) {
+ for (i = 1; i <= num; i++) {
status = camel_imap_command_extended (CAMEL_IMAP_STORE (folder->parent_store), folder,
&result, "FETCH %d BODY.PEEK[HEADER]", i);
@@ -798,6 +819,7 @@ imap_get_summary (CamelFolder *folder, CamelException *ex)
g_free (info->to);
g_free (info->from);
g_free (info);
+ info = NULL;
break;
}
@@ -810,6 +832,7 @@ imap_get_summary (CamelFolder *folder, CamelException *ex)
g_free (info->to);
g_free (info->from);
g_free (info);
+ info = NULL;
break;
}
@@ -823,6 +846,7 @@ imap_get_summary (CamelFolder *folder, CamelException *ex)
g_free (info->to);
g_free (info->from);
g_free (info);
+ info = NULL;
break;
}
@@ -850,6 +874,7 @@ imap_get_summary (CamelFolder *folder, CamelException *ex)
g_free (info->to);
g_free (info->from);
g_free (info);
+ info = NULL;
break;
}
@@ -862,6 +887,7 @@ imap_get_summary (CamelFolder *folder, CamelException *ex)
g_free (info->to);
g_free (info->from);
g_free (info);
+ info = NULL;
break;
}
@@ -875,6 +901,7 @@ imap_get_summary (CamelFolder *folder, CamelException *ex)
g_free (info->to);
g_free (info->from);
g_free (info);
+ info = NULL;
break;
}
@@ -905,23 +932,7 @@ imap_get_summary (CamelFolder *folder, CamelException *ex)
void
imap_free_summary (CamelFolder *folder, GPtrArray *array)
{
- CamelMessageInfo *info;
- gint i, max;
-
- max = array->len;
- for (i = 0; i < max; i++) {
- info = g_ptr_array_index (array, i);
- g_free (info->subject);
- g_free (info->to);
- g_free (info->from);
- g_free (info->uid);
- g_free (info);
- info = NULL;
- }
-
- g_ptr_array_free (array, TRUE);
- array = NULL;
-
+ /* no-op */
return;
}