[anjal] Fix a crash, when closing messages in new tabs



commit 1d08ce79469fdebf49aabbe24b53d1e711236dbd
Author: Srinivasa Ragavan <sragavan novell com>
Date:   Fri Jun 5 14:27:46 2009 +0530

    Fix a crash, when closing messages in new tabs
---
 src/mail-view.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/mail-view.c b/src/mail-view.c
index 6a89a03..a5b6cc0 100644
--- a/src/mail-view.c
+++ b/src/mail-view.c
@@ -244,7 +244,7 @@ mv_close_mcv (MailViewChild *mfv, MailView *mv)
 		 mail_conv_view_activate ((MailConvView *)child, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, FALSE);
 	else if (child->type == MAIL_VIEW_FOLDER) {
 		 mail_folder_view_activate ((MailFolderView *)child, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, TRUE);
-		 mail_search_set_state (mv->priv->search, ((MailFolderView *)mfv)->search_str, ((MailFolderView *)mfv)->search_state);
+		 mail_search_set_state (mv->priv->search, ((MailFolderView *)child)->search_str, ((MailFolderView *)child)->search_state);
 	} else if (child->type == MAIL_VIEW_ACCOUNT)
 		mail_account_view_activate ((MailAccountView *)child, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, FALSE);
 
@@ -263,6 +263,12 @@ mv_message_new (MailFolderView *mfv, gpointer data, char *umid, MailView *mv)
 	return;
 }
 
+static void
+mv_search_set (MailFolderView *mfv, MailView *mv)
+{
+	 mail_search_set_state (mv->priv->search, mfv->search_str, mfv->search_state);
+}
+
 static MailViewChild *
 mail_view_add_folder (MailView *mv, gpointer data)
 {
@@ -280,6 +286,7 @@ mail_view_add_folder (MailView *mv, gpointer data)
 	gtk_notebook_set_tab_label_packing ((GtkNotebook *)mv, (GtkWidget *)mfv, FALSE, FALSE, 0);
 	g_signal_connect (mfv, "message-shown", G_CALLBACK(mv_message_shown), mv);
 	g_signal_connect (mfv, "message-new", G_CALLBACK(mv_message_new), mv);
+	g_signal_connect (mfv, "search-set", G_CALLBACK(mv_search_set), mv);
 
 	mail_folder_view_activate (mfv, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, TRUE);
 



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