From 82f2b2c8d01340ed478e05313e52f1324faaf272 Mon Sep 17 00:00:00 2001 From: hiro Date: Tue, 17 Jan 2006 09:08:28 +0000 Subject: enabled toggle of the searchbar. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@901 ee746299-78ed-0310-b773-934348b2243d --- src/summaryview.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/summaryview.c') diff --git a/src/summaryview.c b/src/summaryview.c index 58b2d592..ebb0cfc8 100644 --- a/src/summaryview.c +++ b/src/summaryview.c @@ -4690,6 +4690,15 @@ void summary_get_column_order(SummaryView *summaryview) void summary_qsearch_reset(SummaryView *summaryview) { + if (!summaryview->on_filter) + return; + + gtk_entry_set_text(GTK_ENTRY(summaryview->search_entry), ""); + + summaryview->on_filter = FALSE; + g_slist_free(summaryview->flt_mlist); + summaryview->flt_mlist = NULL; + summary_lock(summaryview); main_window_cursor_wait(summaryview->mainwin); @@ -4713,9 +4722,8 @@ void summary_qsearch(SummaryView *summaryview) GSList *flt_mlist = NULL; GSList *cur; - summaryview->on_filter = FALSE; - g_slist_free(summaryview->flt_mlist); - summaryview->flt_mlist = NULL; + if (!summaryview->all_mlist) + return; key = gtk_entry_get_text(GTK_ENTRY(summaryview->search_entry)); if (!key || *key == '\0') { @@ -4723,6 +4731,10 @@ void summary_qsearch(SummaryView *summaryview) return; } + summaryview->on_filter = FALSE; + g_slist_free(summaryview->flt_mlist); + summaryview->flt_mlist = NULL; + cond = filter_cond_new(FLT_COND_HEADER, FLT_CONTAIN, 0, "Subject", key); cond_list = g_slist_append(cond_list, cond); cond = filter_cond_new(FLT_COND_HEADER, FLT_CONTAIN, 0, "From", key); -- cgit v1.2.3