diff options
author | Milan Crha <mcrha@redhat.com> | 2008-06-13 14:32:36 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2008-06-13 14:32:36 +0800 |
commit | 00e55f86dfdec77459ca98e80bdc73aecad0bf84 (patch) | |
tree | 6fd8d2b896a7bf1f534961e6cf1ab432b7f2fd56 /mail/message-list.c | |
parent | 2d93a52ec934675dc6c984496988831c1d160331 (diff) | |
download | gsoc2013-evolution-00e55f86dfdec77459ca98e80bdc73aecad0bf84.tar.gz gsoc2013-evolution-00e55f86dfdec77459ca98e80bdc73aecad0bf84.tar.zst gsoc2013-evolution-00e55f86dfdec77459ca98e80bdc73aecad0bf84.zip |
** Fix for bug #337160
2008-06-13 Milan Crha <mcrha@redhat.com>
** Fix for bug #337160
* message-list.c: (on_cursor_activated_cmd): Do not pretend the row
with a cursor is selected when it isn't. Also take care of multiselect.
* message-list.c: (on_selection_changed_cmd):
Do not pretend the row with a cursor is selected when it isn't.
svn path=/trunk/; revision=35633
Diffstat (limited to 'mail/message-list.c')
-rw-r--r-- | mail/message-list.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/mail/message-list.c b/mail/message-list.c index 12bf98f459..e598fa2de5 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -3307,8 +3307,24 @@ on_cursor_activated_cmd (ETree *tree, int row, ETreePath path, gpointer user_dat { MessageList *message_list = MESSAGE_LIST (user_data); const char *new_uid; + ESelectionModel *etsm; + gint selected; + + etsm = e_tree_get_selection_model (message_list->tree); + + selected = e_selection_model_selected_count (etsm); - if (path == NULL) + if (selected == 1) { + GPtrArray *uids; + + uids = message_list_get_selected (message_list); + + new_uid = g_strdup (uids->pdata [0]); + + message_list_free_uids (message_list, uids); + } else if (path == NULL + || !e_selection_model_is_row_selected (etsm, e_selection_model_cursor_row (etsm)) + || selected != 1) new_uid = NULL; else new_uid = get_message_uid (message_list, path); @@ -3332,15 +3348,12 @@ on_selection_changed_cmd(ETree *tree, MessageList *ml) { GPtrArray *uids; char *newuid; - ETreePath cursor; /* not sure if we could just ignore this for the cursor, i think sometimes you only get a selection changed when you should also get a cursor activated? */ uids = message_list_get_selected(ml); if (uids->len == 1) newuid = uids->pdata[0]; - else if ((cursor = e_tree_get_cursor(tree))) - newuid = (char *)camel_message_info_uid(e_tree_memory_node_get_data((ETreeMemory *)tree, cursor)); else newuid = NULL; |