From 6cb88a7819367f8ece5b563a2910571d3c46f77e Mon Sep 17 00:00:00 2001 From: Not Zed Date: Wed, 5 May 2004 13:28:03 +0000 Subject: ** See bug #57720. 2004-05-05 Not Zed ** See bug #57720. * em-folder-browser.c (emfb_create_view_menus): removed some stuff done in create_view_instance in the superclass. * em-folder-view.c (emfv_create_view_instance): moved here from em-folder-browser, setup the view instance for the folder. (emfv_set_folder): if the folder is set, create the view instance. * em-folder-browser.c: moved the galview instance and menu pointers to EMFolderView, since they're basically meta-data on the messagelist @ to fix issues. * em-folder-view.c (em_folder_view_open_selected): copy over the threaded list value when the message browser is brought up. ** some clean up * evolution-mail.schemas.in.in: removed xmailer_mask stuff. * em-migrate.c (mail_display_map[]): Removed xmailer_mask stuff. * em-folder-view.c (emfv_setting_notify): removed xmailer_mask stuff. * em-format-html.c (em_format_html_set_xmailer_mask): removed. This isn't used anymore. ** Fixes the double-draw on separate mail view. * message-list.c (on_cursor_activated_cmd): noop if the cursor and uid match for all cases (clearing uid). (on_selection_changed_cmd): noop if the cursor and new selection hasn't changed & fix a memleak. svn path=/trunk/; revision=25806 --- mail/message-list.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'mail/message-list.c') diff --git a/mail/message-list.c b/mail/message-list.c index 138832c007..9ae5673bd2 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -2641,8 +2641,9 @@ on_cursor_activated_cmd (ETree *tree, int row, ETreePath path, gpointer user_dat new_uid = NULL; else new_uid = get_message_uid (message_list, path); - - if (message_list->cursor_uid != NULL && new_uid != NULL && !strcmp (message_list->cursor_uid, new_uid)) + + if ((message_list->cursor_uid == NULL && new_uid == NULL) + || (message_list->cursor_uid != NULL && new_uid != NULL && !strcmp (message_list->cursor_uid, new_uid))) return; message_list->cursor_row = row; @@ -2660,18 +2661,27 @@ static void on_selection_changed_cmd(ETree *tree, MessageList *ml) { GPtrArray *uids; + char *newuid; /* 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); - g_free(ml->cursor_uid); if (uids->len == 1) - ml->cursor_uid = g_strdup(uids->pdata[0]); + newuid = uids->pdata[0]; else - ml->cursor_uid = NULL; + newuid = NULL; - if (!ml->idle_id) - ml->idle_id = g_idle_add_full (G_PRIORITY_LOW, on_cursor_activated_idle, ml, NULL); + if ((newuid == NULL && ml->cursor_uid == NULL) + || (newuid != NULL && ml->cursor_uid != NULL && !strcmp(ml->cursor_uid, newuid))) { + /* noop */ + } else { + g_free(ml->cursor_uid); + ml->cursor_uid = g_strdup(newuid); + if (!ml->idle_id) + ml->idle_id = g_idle_add_full (G_PRIORITY_LOW, on_cursor_activated_idle, ml, NULL); + } + + message_list_free_uids(ml, uids); } static gint -- cgit v1.2.3