[evolution-patches] [PATCH 09/22] Fix scrolling in folder view. (cherry picked from commit 174625151df9056e4319e63d1e5c64510046ffc5)



From: Srinivasa Ragavan <sragavan gnome org>


Signed-off-by: Yan Li <yanli infradead org>
---
 src/mail-folder-view.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/mail-folder-view.c b/src/mail-folder-view.c
index 1cb6df9..7e1865a 100644
--- a/src/mail-folder-view.c
+++ b/src/mail-folder-view.c
@@ -1228,7 +1228,6 @@ mfv_button_clicked (GtkWidget *w, GdkEventButton *event, MailFolderView *mfv)
 	GtkTreePath *path = NULL;
 	GtkTreeViewColumn *column = NULL;
 
-
 	x = (int) event->x;
 	y = (int) event->y;
 
@@ -1289,7 +1288,6 @@ mfv_message_activated (GtkTreeView       *tree_view,  GtkTreePath       *path, G
 	GtkTreeIter iter;
 	CamelMessageInfo *info = NULL;
 	gboolean outgoing = FALSE;
-
 	
 	if (em_utils_folder_is_drafts(shell->priv->folder, shell->uri)
 		|| em_utils_folder_is_outbox(shell->priv->folder, shell->uri))
@@ -1582,7 +1580,7 @@ mail_folder_view_construct (MailFolderView *shell)
 	GtkCellRenderer *cell;
 	GtkCellRenderer *hbox, *vbox;
 	GtkTreeSelection *sel;
-	
+
 	viewbox = gtk_vbox_new (FALSE, 0);
 	gtk_widget_show (viewbox);
 	infolabel = gtk_label_new (_("Please select a folder on the folder tree"));
@@ -1604,7 +1602,6 @@ mail_folder_view_construct (MailFolderView *shell)
 	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->view_scroller),
 									GTK_POLICY_NEVER,
 									GTK_POLICY_AUTOMATIC);
-
 	gtk_box_pack_start ((GtkBox *)shell, viewbox, TRUE, TRUE, 0);
 	gtk_widget_show ((GtkWidget *)shell);
 	
@@ -1994,6 +1991,10 @@ mail_folder_view_search_done (MailFolderView *mfv, CamelFolder *folder, const ch
 void
 mail_folder_view_set_search (MailFolderView *mfv, const char *search, const char *search_str)
 {
+	if (search_str && mfv->search_str && strcmp (search_str, mfv->search_str) == 0 || 
+		((mfv->search_str == NULL|| *(mfv->search_str) == '\0') && (search_str == NULL|| *search_str == '\0')))
+		return;
+
 	if (mfv->search) {
 		g_free (mfv->search);
 		mfv->search = NULL;
@@ -2004,7 +2005,8 @@ mail_folder_view_set_search (MailFolderView *mfv, const char *search, const char
 		gboolean search_on = (search_str && *search_str) ? TRUE : FALSE;
 		char *str = g_strdup_printf ("%s %c%s%c", search_on ? _("Searching for ") : _("Clearing search"), search_on ? '\'' : ' ', search_on ? search_str : "", search_on ? '\'' : ' ');
 		mfv->search = search ? g_strdup(search) : NULL;
-
+		g_free (mfv->search_str);
+		mfv->search_str = g_strdup (search_str);
 		gtk_tree_view_set_model (GTK_TREE_VIEW (mfv->tree), NULL);
 		gtk_widget_show (mfv->priv->info_spinner);
 		gtk_widget_hide ((GtkWidget *)mfv->mail);
-- 
1.6.5.7



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