diff options
-rw-r--r-- | mail/ChangeLog | 8 | ||||
-rw-r--r-- | mail/folder-browser.c | 1 | ||||
-rw-r--r-- | mail/message-list.c | 7 | ||||
-rw-r--r-- | mail/message-list.h | 1 |
4 files changed, 14 insertions, 3 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index a42d24dcac..153c5c3915 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,8 @@ +2000-05-02 NotZed <NotZed@HelixCode.com> + + * folder-browser.c (folder_browser_gui_init): Connect the changed + signal to search, so it searched immediately? + 2000-05-01 NotZed <NotZed@HelixCode.com> * pixmaps.h: Added envelope-deleted state. @@ -38,6 +43,9 @@ changes. (select_msg): And connect to the message_changed signal so we know when it cahgnes. + (message_list_set_search): Save the search string. + (folder_changed): If the folder changes, re-run the search, + otherwise we may end up with invalid entries in the display. * mail-display.c: Include missing errno.h. diff --git a/mail/folder-browser.c b/mail/folder-browser.c index 455a1af44e..a7e3e74b70 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -313,6 +313,7 @@ folder_browser_gui_init (FolderBrowser *fb) fb->search_entry = gtk_entry_new(); gtk_widget_show(fb->search_entry); gtk_signal_connect(fb->search_entry, "activate", search_activate, fb); + gtk_signal_connect(fb->search_entry, "changed", search_activate, fb); label = gtk_label_new("Search"); gtk_widget_show(label); fb->search_menu = create_option_menu(search_options, 0, fb); diff --git a/mail/message-list.c b/mail/message-list.c index 9a535975dd..067c3616d7 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -151,7 +151,7 @@ ml_row_count (ETableModel *etm, void *data) if (camel_exception_get_id (&ex)) v = 0; } - + /* in the case where no message is available, return 1 * however, cause we want to be able to show a text */ return (v ? v:1); @@ -690,11 +690,13 @@ message_list_set_search (MessageList *message_list, const char *search) g_list_free(message_list->matches); message_list->matches = NULL; } + g_free(message_list->search); if (search) { CamelException ex; camel_exception_init (&ex); message_list->matches = camel_folder_search_by_expression(message_list->folder, search, &ex); + message_list->search = g_strdup(search); } e_table_model_changed (message_list->table_model); @@ -704,8 +706,7 @@ message_list_set_search (MessageList *message_list, const char *search) static void folder_changed(CamelFolder *f, int type, MessageList *message_list) { - e_table_model_changed (message_list->table_model); - select_msg (message_list, 0); + message_list_set_search(message_list, message_list->search); } void diff --git a/mail/message-list.h b/mail/message-list.h index e4d7189278..7c1e6bcb5b 100644 --- a/mail/message-list.h +++ b/mail/message-list.h @@ -59,6 +59,7 @@ struct _MessageList { CamelFolder *folder; + char *search; /* search string */ /* FIXME: This should use a better format ... */ GList *matches; /* when a search has been performed ... */ |