aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Zucci <zucchi@src.gnome.org>2000-05-03 01:53:26 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-05-03 01:53:26 +0800
commitab96ee0005ce9a33df2217553d07c53be0e9ba69 (patch)
treef56919eab3929fc92aa2333547a6758538583af0
parentee108c89b92ae4ae0b35fc1ff38314bb34d3654c (diff)
downloadgsoc2013-evolution-ab96ee0005ce9a33df2217553d07c53be0e9ba69.tar
gsoc2013-evolution-ab96ee0005ce9a33df2217553d07c53be0e9ba69.tar.gz
gsoc2013-evolution-ab96ee0005ce9a33df2217553d07c53be0e9ba69.tar.bz2
gsoc2013-evolution-ab96ee0005ce9a33df2217553d07c53be0e9ba69.tar.lz
gsoc2013-evolution-ab96ee0005ce9a33df2217553d07c53be0e9ba69.tar.xz
gsoc2013-evolution-ab96ee0005ce9a33df2217553d07c53be0e9ba69.tar.zst
gsoc2013-evolution-ab96ee0005ce9a33df2217553d07c53be0e9ba69.zip
> 2000-05-02 NotZed <NotZed@HelixCode.com>
> > * folder-browser.c (folder_browser_gui_init): Connect the changed > signal to search, so it searched immediately? > 40a46,48 > (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. svn path=/trunk/; revision=2749
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/folder-browser.c1
-rw-r--r--mail/message-list.c7
-rw-r--r--mail/message-list.h1
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 ... */