diff options
author | Not Zed <NotZed@Ximian.com> | 2004-04-14 18:33:38 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-04-14 18:33:38 +0800 |
commit | 783645304dffa63ba978ceec1874f6e9cd7f419a (patch) | |
tree | 3582bc79db91d67c6f4aa4491daa45a2a8d725ee /mail/message-list.c | |
parent | 3cf228772512334661adb91a1a709b6a2962651f (diff) | |
download | gsoc2013-evolution-783645304dffa63ba978ceec1874f6e9cd7f419a.tar.gz gsoc2013-evolution-783645304dffa63ba978ceec1874f6e9cd7f419a.tar.zst gsoc2013-evolution-783645304dffa63ba978ceec1874f6e9cd7f419a.zip |
ugh, use the queued thread to get the folder, otherwise we can get folders
2004-04-14 Not Zed <NotZed@Ximian.com>
* em-folder-view.c (emfv_set_folder_uri): ugh, use the queued
thread to get the folder, otherwise we can get folders set on the
display out of order.
* message-list.c (message_list_set_search): if we set this while
frozen, save the search elsewhere.
(message_list_thaw): if we had a frozen-time search, use it when
we regenerate.
* em-folder-browser.c (emfb_set_folder): freeze/thaw the
messagelist around changes so we don't have multiple updates fire
off changing folders.
(emfb_activate): remove an unused variable i never used.
* message-list.c (message_list_freeze, message_list_thaw): lock
some updates to the ui, so you can do things like set folder and
search atomically.
(message_list_set_threaded, message_list_set_hidedeleted)
(message_list_set_search, message_list_hide_uids)
(message_list_hide_clear, message_list_set_folder): dont refresh
the list if we're frozen.
svn path=/trunk/; revision=25458
Diffstat (limited to 'mail/message-list.c')
-rw-r--r-- | mail/message-list.c | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/mail/message-list.c b/mail/message-list.c index 645c16933a..a8e2e85d58 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -1686,6 +1686,7 @@ message_list_finalise (GObject *object) message_list->hidden_pool = NULL; } + g_free(message_list->frozen_search); g_free(message_list->cursor_uid); g_mutex_free(message_list->hide_lock); @@ -2592,7 +2593,8 @@ message_list_set_folder (MessageList *message_list, CamelFolder *folder, const c message_list->hidejunk = junk_folder && !(folder->folder_flags & CAMEL_FOLDER_IS_JUNK) && !(folder->folder_flags & CAMEL_FOLDER_IS_TRASH); load_hide_state (message_list); - mail_regen_list (message_list, message_list->search, NULL, NULL); + if (message_list->frozen == 0) + mail_regen_list (message_list, message_list->search, NULL, NULL); } } @@ -2771,6 +2773,25 @@ message_list_get_selected(MessageList *ml) return data.uids; } +void +message_list_freeze(MessageList *ml) +{ + ml->frozen++; +} + +void +message_list_thaw(MessageList *ml) +{ + g_assert(ml->frozen != 0); + + ml->frozen--; + if (ml->frozen == 0) { + mail_regen_list(ml, ml->frozen_search?ml->frozen_search:ml->search, NULL, NULL); + g_free(ml->frozen_search); + ml->frozen_search = NULL; + } +} + void message_list_free_uids(MessageList *ml, GPtrArray *uids) { int i; @@ -2787,7 +2808,8 @@ message_list_set_threaded (MessageList *ml, gboolean threaded) if (ml->threaded != threaded) { ml->threaded = threaded; - mail_regen_list (ml, ml->search, NULL, NULL); + if (ml->frozen == 0) + mail_regen_list (ml, ml->search, NULL, NULL); } } @@ -2797,7 +2819,8 @@ message_list_set_hidedeleted (MessageList *ml, gboolean hidedeleted) if (ml->hidedeleted != hidedeleted) { ml->hidedeleted = hidedeleted; - mail_regen_list (ml, ml->search, NULL, NULL); + if (ml->frozen == 0) + mail_regen_list (ml, ml->search, NULL, NULL); } } @@ -2815,8 +2838,13 @@ message_list_set_search (MessageList *ml, const char *search) camel_folder_thread_messages_unref(ml->thread_tree); ml->thread_tree = NULL; } - - mail_regen_list (ml, search, NULL, NULL); + + if (ml->frozen == 0) + mail_regen_list (ml, search, NULL, NULL); + else { + g_free(ml->frozen_search); + ml->frozen_search = g_strdup(search); + } } /* returns the number of messages displayable *after* expression hiding has taken place */ @@ -2862,7 +2890,6 @@ message_list_hidden(MessageList *ml) return hidden; } - /* add a new expression to hide, or set the range. @expr: A new search expression - all matching messages will be hidden. May be %NULL. @lower: Use ML_HIDE_NONE_START to specify no messages hidden from the start of the list. @@ -2918,7 +2945,8 @@ message_list_hide_uids (MessageList *ml, GPtrArray *uids) MESSAGE_LIST_UNLOCK (ml, hide_lock); /* save this here incase the user pops up another window, so they are consistent */ save_hide_state(ml); - mail_regen_list (ml, ml->search, NULL, NULL); + if (ml->frozen == 0) + mail_regen_list (ml, ml->search, NULL, NULL); break; } } @@ -2946,7 +2974,8 @@ message_list_hide_clear (MessageList *ml) /* save this here incase the user pops up another window, so they are consistent */ save_hide_state(ml); - mail_regen_list (ml, ml->search, NULL, NULL); + if (ml->frozen == 0) + mail_regen_list (ml, ml->search, NULL, NULL); } #define HIDE_STATE_VERSION (1) |