From 4e4eb45bf69d539996b298a13bf650c5ebea7f16 Mon Sep 17 00:00:00 2001 From: bertrand Date: Sun, 5 Sep 1999 16:15:12 +0000 Subject: use folder summary instead of opening all messages. 1999-09-05 bertrand * tests/ui-tests/store_listing.c (show_folder_messages): use folder summary instead of opening all messages. * camel/providers/MH/camel-mh-folder.c (_create_summary): basic and highly non-efficient summary implementation. Should be seen as a proof of concept only. subfolder summary still has to be implemented. * camel/providers/maildir/camel-maildir-folder.c (_init_with_store): hasn't summary for the moment. * camel/providers/maildir/camel-maildir-folder.c cosmetic changes. svn path=/trunk/; revision=1178 --- tests/ui-tests/store_listing.c | 45 +++++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 9 deletions(-) (limited to 'tests/ui-tests') diff --git a/tests/ui-tests/store_listing.c b/tests/ui-tests/store_listing.c index 526bd3c9f7..ca69985221 100644 --- a/tests/ui-tests/store_listing.c +++ b/tests/ui-tests/store_listing.c @@ -14,6 +14,7 @@ #include "camel-mh-folder.h" #include "camel-mh-store.h" #include "camel.h" +#include "camel-folder-summary.h" static GladeXML *xml; static CamelSession *_session; @@ -132,19 +133,22 @@ show_folder_messages (CamelFolder *folder) const gchar *clist_row_text[3]; const char *sent_date, *subject, *sender; gint current_row; + CamelFolderSummary *summary; message_clist = glade_xml_get_widget (xml, "message-clist"); /* clear old message list */ gtk_clist_clear (GTK_CLIST (message_clist)); - + +#if 0 folder_message_count = camel_folder_get_message_count (folder); + for (i=0; idata; + clist_row_text [0] = msg_info->date; + clist_row_text [1] = msg_info->sender; + clist_row_text [2] = msg_info->subject; + printf ("New message : subject = %s\n", msg_info->subject); + current_row = gtk_clist_append (GTK_CLIST (message_clist), clist_row_text); + + message_info_list = message_info_list->next; + } + } else { + printf ("Folder does not have summary. Skipping\n"); + } } - /* add a mail store given by its URL */ static void add_mail_store (const gchar *store_url) @@ -200,10 +224,13 @@ add_mail_store (const gchar *store_url) /* normally, use get_root_folder */ root_folder = camel_store_get_folder (store, ""); + camel_folder_open (root_folder, FOLDER_OPEN_RW); subfolder_list = camel_folder_list_subfolders (root_folder); while (subfolder_list) { new_tree_text[0] = subfolder_list->data; new_folder = camel_store_get_folder (store, subfolder_list->data); + camel_folder_open (new_folder, FOLDER_OPEN_RW); + new_folder_node = gtk_ctree_insert_node (GTK_CTREE (mailbox_and_store_tree), new_store_node, NULL, -- cgit v1.2.3