diff options
author | bertrand <Bertrand.Guiheneuf@aful.org> | 1999-09-06 00:15:12 +0800 |
---|---|---|
committer | Bertrand Guiheneuf <bertrand@src.gnome.org> | 1999-09-06 00:15:12 +0800 |
commit | 4e4eb45bf69d539996b298a13bf650c5ebea7f16 (patch) | |
tree | 359e98c1b0f050769df800a8e7456db192c03310 /tests/ui-tests | |
parent | 0fe7101224105602a18e63eb83af4611648c9d91 (diff) | |
download | gsoc2013-evolution-4e4eb45bf69d539996b298a13bf650c5ebea7f16.tar.gz gsoc2013-evolution-4e4eb45bf69d539996b298a13bf650c5ebea7f16.tar.zst gsoc2013-evolution-4e4eb45bf69d539996b298a13bf650c5ebea7f16.zip |
use folder summary instead of opening all messages.
1999-09-05 bertrand <Bertrand.Guiheneuf@aful.org>
* 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
Diffstat (limited to 'tests/ui-tests')
-rw-r--r-- | tests/ui-tests/store_listing.c | 45 |
1 files changed, 36 insertions, 9 deletions
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; i<folder_message_count; i++) { - message = camel_folder_get_message (folder, i); - gtk_object_ref (GTK_OBJECT (message)); - sent_date = camel_mime_message_get_sent_date (message); - sender = camel_mime_message_get_from (message); - subject = camel_mime_message_get_subject (message); + message = camel_folder_get_message (folder, i); + gtk_object_ref (GTK_OBJECT (message)); + sent_date = camel_mime_message_get_sent_date (message); + sender = camel_mime_message_get_from (message); + subject = camel_mime_message_get_subject (message); if (sent_date) clist_row_text [0] = sent_date; @@ -158,12 +162,32 @@ show_folder_messages (CamelFolder *folder) gtk_clist_set_row_data_full (GTK_CLIST (message_clist), current_row, (gpointer)message, message_destroy_notify); } - - +#endif + + if (camel_folder_has_summary_capability (folder)) { + const GList *message_info_list; + CamelMessageInfo *msg_info; + + printf ("Folder has summary. Good\n"); + summary = camel_folder_get_summary (folder); + message_info_list = camel_folder_summary_get_message_info_list (summary); + printf ("message_info_list = %p\n", message_info_list); + while (message_info_list) { + msg_info = (CamelMessageInfo *)message_info_list->data; + 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, |