aboutsummaryrefslogtreecommitdiffstats
path: root/mail/message-list.c
diff options
context:
space:
mode:
authorBertrand Guiheneuf <bertrand@src.gnome.org>2000-03-08 02:16:11 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>2000-03-08 02:16:11 +0800
commitc2a6758ac4bed7092dd4199fe47880f3a095d4df (patch)
treedb5995aa3a4399b89fd8d498022d6af4a6d02e6c /mail/message-list.c
parent34ddede07c695d6cedb80be5f45cc76f917e34ad (diff)
downloadgsoc2013-evolution-c2a6758ac4bed7092dd4199fe47880f3a095d4df.tar.gz
gsoc2013-evolution-c2a6758ac4bed7092dd4199fe47880f3a095d4df.tar.zst
gsoc2013-evolution-c2a6758ac4bed7092dd4199fe47880f3a095d4df.zip
sync from laptop
svn path=/trunk/; revision=2077
Diffstat (limited to 'mail/message-list.c')
-rw-r--r--mail/message-list.c105
1 files changed, 41 insertions, 64 deletions
diff --git a/mail/message-list.c b/mail/message-list.c
index d3be8d36f0..caaede7d3a 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -5,6 +5,7 @@
*
* Author:
* Miguel de Icaza (miguel@helixcode.com)
+ * Bertrand Guiheneuf (bg@aful.org)
*
* (C) 2000 Helix Code, Inc.
*/
@@ -53,6 +54,43 @@ on_row_selection_cmd (ETable *table,
+/* select a message and display it */
+static void
+select_msg (MessageList *message_list, gint row)
+{
+ CamelException ex;
+ CamelMimeMessage *message = NULL;
+
+ camel_exception_init (&ex);
+
+ if (camel_folder_has_uid_capability (message_list->folder)) {
+ const GArray *msg_info_array;
+ CamelMessageInfo msg_info;
+
+ msg_info_array = camel_folder_summary_get_message_info_list
+ (message_list->folder_summary);
+
+ if (msg_info_array->len > 0 ) {
+ msg_info = g_array_index (msg_info_array, CamelMessageInfo, row);
+
+ message = camel_folder_get_message_by_uid (message_list->folder,
+ msg_info.uid,
+ &ex);
+ if (camel_exception_get_id (&ex)) {
+ printf ("Unable to get message: %s\n",
+ ex.desc?ex.desc:"unknown_reason");
+ return;
+ }
+ }
+
+ printf ("Message = %p\n", message);
+ if (message)
+ mail_display_set_message (message_list->parent_folder_browser->mail_display,
+ CAMEL_MEDIUM (message));
+ }
+
+}
+
/*
* SimpleTableModel::col_count
*/
@@ -597,7 +635,6 @@ message_list_set_folder (MessageList *message_list, CamelFolder *camel_folder)
{
CamelException ex;
gboolean folder_exists;
- CamelMimeMessage *message;
g_return_if_fail (message_list != NULL);
g_return_if_fail (camel_folder != NULL);
@@ -661,38 +698,7 @@ message_list_set_folder (MessageList *message_list, CamelFolder *camel_folder)
printf ("Modelo cambio!\n");
e_table_model_changed (message_list->table_model);
- /* FIXME : put that in a separate function */
- /* display the (first) message (in this case) */
- if (camel_folder_has_uid_capability (camel_folder)) {
- const GArray *msg_info_array;
- CamelMessageInfo msg_info;
-
- msg_info_array = camel_folder_summary_get_message_info_list
- (message_list->folder_summary);
-
- if (msg_info_array->len > 0 ) {
- msg_info = g_array_index (msg_info_array, CamelMessageInfo, 0);
-
- message = camel_folder_get_message_by_uid (message_list->folder,
- msg_info.uid,
- &ex);
- if (camel_exception_get_id (&ex)) {
- printf ("Unable to get message: %s\n",
- ex.desc?ex.desc:"unknown_reason");
- return;
- }
- }
-
- printf ("Message = %p\n", message);
- /*if (message)
- mail_display_set_message (message_list->parent_folder_browser->mail_display,
- CAMEL_MEDIUM (message));*/
-
-
-
- } else
- g_warning ("FIXME : folder does not support UIDS\n");
-
+ select_msg (message_list, 1);
}
GtkWidget *
@@ -705,6 +711,7 @@ E_MAKE_TYPE (message_list, "MessageList", MessageList, message_list_class_init,
+
static void
on_row_selection_cmd (ETable *table,
int row,
@@ -712,42 +719,12 @@ on_row_selection_cmd (ETable *table,
gpointer user_data)
{
MessageList *message_list;
- CamelException ex;
- gboolean folder_exists;
- CamelMimeMessage *message;
message_list = MESSAGE_LIST (user_data);
- camel_exception_init (&ex);
if ( selected ) {
g_print ("Row %d selected\n", row);
- /* FIXME : put that in a separate function */
- /* display the (first) message (in this case) */
- if (camel_folder_has_uid_capability (message_list->folder)) {
- const GArray *msg_info_array;
- CamelMessageInfo msg_info;
-
- msg_info_array = camel_folder_summary_get_message_info_list
- (message_list->folder_summary);
-
- if (msg_info_array->len > 0 ) {
- msg_info = g_array_index (msg_info_array, CamelMessageInfo, row);
-
- message = camel_folder_get_message_by_uid (message_list->folder,
- msg_info.uid,
- &ex);
- if (camel_exception_get_id (&ex)) {
- printf ("Unable to get message: %s\n",
- ex.desc?ex.desc:"unknown_reason");
- return;
- }
- }
-
- printf ("Message = %p\n", message);
- if (message)
- mail_display_set_message (message_list->parent_folder_browser->mail_display,
- CAMEL_MEDIUM (message));
- }
+ select_msg (message_list, row);
} else {
g_print ("Row %d unselected\n", row);
}