[anjal] Make search, storabe per tab.



commit bb065afa3e0430b90c53812df485af1b78771128
Author: Srinivasa Ragavan <sragavan novell com>
Date:   Wed Jun 3 11:50:59 2009 +0530

    Make search, storabe per tab.
---
 src/mail-search.c |    8 +++++++-
 src/mail-view.c   |    4 ++++
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/src/mail-search.c b/src/mail-search.c
index 07e3f8a..809d180 100644
--- a/src/mail-search.c
+++ b/src/mail-search.c
@@ -182,6 +182,12 @@ mail_search_new ()
 void 
 mail_search_set_state (MailSearch *search, const char *word, const char *state)
 {
-	//printf("Search: %s:%s\n", word, state);
+	if (!state || !*state)
+		return;
+
+	g_signal_handlers_block_by_func (search->priv->bar, mail_search_activate, search);
+	g_object_set(search->priv->bar, "state", state, NULL);
+	e_search_bar_set_text ((ESearchBar *)search->priv->bar, (word && *word) ? word : "");
+	g_signal_handlers_unblock_by_func (search->priv->bar, mail_search_activate, search);
 }
 
diff --git a/src/mail-view.c b/src/mail-view.c
index b3675c2..f966efd 100644
--- a/src/mail-view.c
+++ b/src/mail-view.c
@@ -608,6 +608,10 @@ mail_view_set_search (MailView *mv, const char *search, char *state)
 
 	if (child->type == MAIL_VIEW_FOLDER) {
 		MailFolderView *mfv = (MailFolderView *)child;
+
+		if (g_strcmp0 (mfv->search_state, state) == 0 &&
+				g_strcmp0 (mfv->search, search) == 0)
+			return;
 		if (mfv->search_state)
 			g_free (mfv->search_state);
 		mfv->search_state = state;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]