diff options
author | Dan Winship <danw@src.gnome.org> | 2000-03-25 13:20:41 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-03-25 13:20:41 +0800 |
commit | 1e77b479c3e3ecb709907de4d03c2477184e8409 (patch) | |
tree | ed64372a8f829c1b6cc022982fa38ad0212a05d8 | |
parent | a74c859d8c64ac576255fbc36b5f59468b42ddce (diff) | |
download | gsoc2013-evolution-1e77b479c3e3ecb709907de4d03c2477184e8409.tar.gz gsoc2013-evolution-1e77b479c3e3ecb709907de4d03c2477184e8409.tar.zst gsoc2013-evolution-1e77b479c3e3ecb709907de4d03c2477184e8409.zip |
update for summary changes. Hey, neat, it really does make it more
* message-list.c (select_msg, ml_value_at): update for summary
changes. Hey, neat, it really does make it more efficient.
svn path=/trunk/; revision=2160
-rw-r--r-- | mail/ChangeLog | 5 | ||||
-rw-r--r-- | mail/message-list.c | 73 |
2 files changed, 50 insertions, 28 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 47783e4f0b..b0834cb5ac 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,8 @@ +2000-03-25 Dan Winship <danw@helixcode.com> + + * message-list.c (select_msg, ml_value_at): update for summary + changes. Hey, neat, it really does make it more efficient. + 2000-03-22 Christopher James Lahey <clahey@helixcode.com> * .cvsignore: Updated .cvsignore. diff --git a/mail/message-list.c b/mail/message-list.c index 4ca27fb165..db5ea0ea26 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -64,17 +64,17 @@ select_msg (MessageList *message_list, gint row) camel_exception_init (&ex); if (camel_folder_has_uid_capability (message_list->folder)) { - const GArray *msg_info_array; - CamelMessageInfo msg_info; + GPtrArray *msg_info_array; + CamelMessageInfo *msg_info; - msg_info_array = camel_folder_summary_get_message_info_list - (message_list->folder_summary); + msg_info_array = camel_folder_summary_get_message_info + (message_list->folder_summary, row, 1); - if (msg_info_array->len > 0 ) { - msg_info = g_array_index (msg_info_array, CamelMessageInfo, row); + if (msg_info_array) { + msg_info = msg_info_array->pdata[0]; message = camel_folder_get_message_by_uid (message_list->folder, - msg_info.uid, + msg_info->uid, &ex); if (camel_exception_get_id (&ex)) { printf ("Unable to get message: %s\n", @@ -83,6 +83,8 @@ select_msg (MessageList *message_list, gint row) } } + g_ptr_array_free (msg_info_array, TRUE); + printf ("Message = %p\n", message); if (message) mail_display_set_message (message_list->parent_folder_browser->mail_display, @@ -132,9 +134,10 @@ ml_value_at (ETableModel *etm, int col, int row, void *data) static char buffer [10]; MessageList *message_list = data; CamelFolderSummary *summary; - const GArray *msg_info_array; - CamelMessageInfo msg_info; + GPtrArray *msg_info_array; + CamelMessageInfo *msg_info; CamelException ex; + void *retval = NULL; camel_exception_init (&ex); @@ -144,7 +147,8 @@ ml_value_at (ETableModel *etm, int col, int row, void *data) /* retrieve the message information array */ - msg_info_array = camel_folder_summary_get_message_info_list (summary); + msg_info_array = camel_folder_summary_get_message_info (summary, + row, 1); /* * in the case where it is zero message long @@ -153,58 +157,71 @@ ml_value_at (ETableModel *etm, int col, int row, void *data) if (msg_info_array->len == 0) goto nothing_to_see; - msg_info = g_array_index (msg_info_array, CamelMessageInfo, row); + msg_info = msg_info_array->pdata[0]; switch (col){ case COL_ONLINE_STATUS: - return GINT_TO_POINTER (0); + retval = GINT_TO_POINTER (0); + break; case COL_MESSAGE_STATUS: - return GINT_TO_POINTER (1); + retval = GINT_TO_POINTER (1); + break; case COL_PRIORITY: - return GINT_TO_POINTER (1); + retval = GINT_TO_POINTER (1); + break; case COL_ATTACHMENT: - return GINT_TO_POINTER (0); + retval = GINT_TO_POINTER (0); + break; case COL_FROM: - if (msg_info.sender) - return msg_info.sender; + if (msg_info->sender) + retval = msg_info->sender; else - return ""; + retval = ""; + break; case COL_SUBJECT: - if (msg_info.subject) - return msg_info.subject; + if (msg_info->subject) + retval = msg_info->subject; else - return ""; + retval = ""; + break; case COL_SENT: - return "sent"; + retval = "sent"; + break; case COL_RECEIVE: - return "receive"; + retval = "receive"; + break; case COL_TO: - return "dudes@server"; + retval = "dudes@server"; + break; case COL_SIZE: - sprintf (buffer, "%d", msg_info.size); - return buffer; + sprintf (buffer, "%d", msg_info->size); + retval = buffer; + break; default: g_assert_not_reached (); } - return NULL; + + g_ptr_array_free (msg_info_array, TRUE); + return retval; nothing_to_see : /* * in the case there is nothing to look at, - * notice the user. + * notify the user. */ + g_ptr_array_free (msg_info_array, TRUE); if (col == COL_SUBJECT) return "No item in this view"; else |