[Commits] [SCM] claws branch, master, updated. 3.9.3-131-gcbcbd9f

colin at claws-mail.org colin at claws-mail.org
Thu May 1 11:07:45 CEST 2014


The branch master of project "claws" (Claws Mail) has been updated
       via  cbcbd9f670977dc662cc57ffc16c9da0785d09e5 (commit)
       via  69ad42ac63e99ea220f04043b6fc832f57654ff4 (commit)
       via  37c645c548099e584a0e81a0b50d412d397e1d61 (commit)
       via  3b9495ffd45462514899cf4d247e9703dcf5e748 (commit)
      from  8880d1a9996875e5cb872509de1d47c22e0b9b04 (commit)


- Log -----------------------------------------------------------------
commit cbcbd9f670977dc662cc57ffc16c9da0785d09e5
Author: Colin Leroy <colin at colino.net>
Date:   Thu May 1 11:07:02 2014 +0200

    Better fix: cancel cb also when moving, exec'ing, etc

diff --git a/src/summaryview.c b/src/summaryview.c
index 744e781..d45091f 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -1587,6 +1587,12 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
 
 #undef CURRENTLY_DISPLAYED
 
+static void summary_cancel_mark_read_timeout(SummaryView *summaryview) {
+	if (summaryview->mark_as_read_timeout_tag != 0) {
+		g_source_remove(summaryview->mark_as_read_timeout_tag);
+		summaryview->mark_as_read_timeout_tag = 0;
+	}
+}
 
 void summary_clear_list(SummaryView *summaryview)
 {
@@ -1603,10 +1609,7 @@ void summary_clear_list(SummaryView *summaryview)
 		summaryview->folder_item = NULL;
 	}
 
-	if (summaryview->mark_as_read_timeout_tag != 0) {
-		g_source_remove(summaryview->mark_as_read_timeout_tag);
-		summaryview->mark_as_read_timeout_tag = 0;
-	}
+	summary_cancel_mark_read_timeout(summaryview);
 
 	summaryview->display_msg = FALSE;
 
@@ -2254,10 +2257,7 @@ void summary_select_node(SummaryView *summaryview, GtkCMCTreeNode *node,
 	if (!summaryview->folder_item)
 		return;
 	if (node) {
-		if (summaryview->mark_as_read_timeout_tag != 0) {
-			g_source_remove(summaryview->mark_as_read_timeout_tag);
-			summaryview->mark_as_read_timeout_tag = 0;
-		}
+		summary_cancel_mark_read_timeout(summaryview);
 		gtkut_ctree_expand_parent_all(ctree, node);
 		if (do_refresh) {
 			summary_lock(summaryview);
@@ -4927,6 +4927,7 @@ gboolean summary_execute(SummaryView *summaryview)
 
 		if (node == summaryview->displayed) {
 			messageview_clear(summaryview->messageview);
+			summary_cancel_mark_read_timeout(summaryview);
 			summaryview->displayed = NULL;
 		}
 		if (GTK_CMCTREE_ROW(node)->children != NULL) {
@@ -5027,6 +5028,7 @@ gboolean summary_expunge(SummaryView *summaryview)
 
 		if (node == summaryview->displayed) {
 			messageview_clear(summaryview->messageview);
+			summary_cancel_mark_read_timeout(summaryview);
 			summaryview->displayed = NULL;
 		}
 		if (GTK_CMCTREE_ROW(node)->children != NULL) {
@@ -5459,6 +5461,8 @@ static void summary_unthread_for_exec_func(GtkCMCTree *ctree, GtkCMCTreeNode *no
 	if (node == summaryview->displayed)
 		summaryview->displayed = NULL;
 
+	summary_cancel_mark_read_timeout(summaryview);
+	
 	for (top_parent = node;
 	     GTK_CMCTREE_ROW(top_parent)->parent != NULL;
 	     top_parent = GTK_CMCTREE_ROW(top_parent)->parent)

commit 69ad42ac63e99ea220f04043b6fc832f57654ff4
Author: Colin Leroy <colin at colino.net>
Date:   Thu May 1 10:54:47 2014 +0200

    Track the mark-as-read timeout to be able to cancel it properly
    when changing message or folder. Should fix bug #1644, "race condition
    between message move and mark as read after timeout", bug #2145 "Claws
    becomes unresponsive and gets Killed while moving messages between imap
    folders", and bug #2643 "claws crash when accessing imap folder"

diff --git a/src/summaryview.c b/src/summaryview.c
index fe37768..744e781 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -1603,6 +1603,11 @@ void summary_clear_list(SummaryView *summaryview)
 		summaryview->folder_item = NULL;
 	}
 
+	if (summaryview->mark_as_read_timeout_tag != 0) {
+		g_source_remove(summaryview->mark_as_read_timeout_tag);
+		summaryview->mark_as_read_timeout_tag = 0;
+	}
+
 	summaryview->display_msg = FALSE;
 
 	summaryview->selected = NULL;
@@ -2249,6 +2254,10 @@ void summary_select_node(SummaryView *summaryview, GtkCMCTreeNode *node,
 	if (!summaryview->folder_item)
 		return;
 	if (node) {
+		if (summaryview->mark_as_read_timeout_tag != 0) {
+			g_source_remove(summaryview->mark_as_read_timeout_tag);
+			summaryview->mark_as_read_timeout_tag = 0;
+		}
 		gtkut_ctree_expand_parent_all(ctree, node);
 		if (do_refresh) {
 			summary_lock(summaryview);
@@ -3542,8 +3551,10 @@ static int msginfo_mark_as_read_timeout(void *data)
 				     mdata->summaryview->selected);
 	procmsg_msginfo_free(mdata->msginfo);
 
+	mdata->summaryview->mark_as_read_timeout_tag = 0;
+
 	g_free(mdata);
-	return FALSE;	
+	return FALSE;
 }
 
 static void summary_display_msg_full(SummaryView *summaryview,
@@ -3620,12 +3631,17 @@ static void summary_display_msg_full(SummaryView *summaryview,
 			MarkAsReadData *data = g_new0(MarkAsReadData, 1);
 			data->summaryview = summaryview;
 			data->msginfo = procmsg_msginfo_new_ref(msginfo);
+			if (summaryview->mark_as_read_timeout_tag != 0)
+				g_source_remove(summaryview->mark_as_read_timeout_tag);
+
 #if GLIB_CHECK_VERSION(2,14,0)
-			g_timeout_add_seconds(prefs_common.mark_as_read_delay,
-				msginfo_mark_as_read_timeout, data);
+			summaryview->mark_as_read_timeout_tag = 
+				g_timeout_add_seconds(prefs_common.mark_as_read_delay,
+					msginfo_mark_as_read_timeout, data);
 #else
-			g_timeout_add(prefs_common.mark_as_read_delay * 1000,
-				msginfo_mark_as_read_timeout, data);
+			summaryview->mark_as_read_timeout_tag = 
+				g_timeout_add(prefs_common.mark_as_read_delay * 1000,
+					msginfo_mark_as_read_timeout, data);
 #endif
 		} else if (new_window || !prefs_common.mark_as_read_on_new_window) {
 			msginfo_mark_as_read(summaryview, msginfo, row);
diff --git a/src/summaryview.h b/src/summaryview.h
index 784e869..205e2a1 100644
--- a/src/summaryview.h
+++ b/src/summaryview.h
@@ -170,7 +170,8 @@ private:
 	// folders with matches for recursive quicksearch queries
 	GSList *recursive_matched_folders;
 	FolderItem *search_root_folder;
-	
+
+	guint mark_as_read_timeout_tag;
 #if !GTK_CHECK_VERSION(2,12,0)
 	GtkTooltips *tooltips;
 #endif

commit 37c645c548099e584a0e81a0b50d412d397e1d61
Author: Colin Leroy <colin at colino.net>
Date:   Thu May 1 10:19:56 2014 +0200

    Better fix

diff --git a/src/gtk/quicksearch.c b/src/gtk/quicksearch.c
index eadaef1..987de79 100644
--- a/src/gtk/quicksearch.c
+++ b/src/gtk/quicksearch.c
@@ -77,7 +77,7 @@ struct _QuickSearch
 	gboolean			 running;
 	gboolean			 has_focus;
 	gboolean			 in_typing;
-	gint				 press_timeout_id;
+	guint				 press_timeout_id;
 
 	GList				*normal_search_strings;
 	GList				*extended_search_strings;
@@ -303,7 +303,7 @@ static void searchbar_changed_cb(GtkWidget *widget, QuickSearch *qs)
 	}
 
 	if (prefs_common.summary_quicksearch_dynamic) {
-		if (qs->press_timeout_id != -1) {
+		if (qs->press_timeout_id != 0) {
 			g_source_remove(qs->press_timeout_id);
 		}
 		qs->press_timeout_id = g_timeout_add(500,
@@ -340,9 +340,9 @@ static gboolean searchbar_pressed(GtkWidget *widget, GdkEventKey *event,
 	}
 
 	if (event != NULL && (event->keyval == GDK_KEY_Return || event->keyval == GDK_KEY_KP_Enter)) {
-		if (quicksearch->press_timeout_id != -1) {
+		if (quicksearch->press_timeout_id != 0) {
 			g_source_remove(quicksearch->press_timeout_id);
-			quicksearch->press_timeout_id = -1;
+			quicksearch->press_timeout_id = 0;
 		}
 		quicksearch->in_typing = FALSE;
 		/* add expression to history list and exec quicksearch */
@@ -637,7 +637,7 @@ QuickSearch *quicksearch_new()
 	quicksearch->active = FALSE;
 	quicksearch->running = FALSE;
 	quicksearch->in_typing = FALSE;
-	quicksearch->press_timeout_id = -1;
+	quicksearch->press_timeout_id = 0;
 	quicksearch->normal_search_strings = NULL;
 	quicksearch->extended_search_strings = NULL;
 
@@ -809,7 +809,7 @@ QuickSearch *quicksearch_new()
 	quicksearch->running = FALSE;
 	quicksearch->clear_search = clear_search;
 	quicksearch->in_typing = FALSE;
-	quicksearch->press_timeout_id = -1;
+	quicksearch->press_timeout_id = 0;
 	quicksearch->normal_search_strings = NULL;
 	quicksearch->extended_search_strings = NULL;
 

commit 3b9495ffd45462514899cf4d247e9703dcf5e748
Author: Colin Leroy <colin at colino.net>
Date:   Thu May 1 10:18:57 2014 +0200

    Fix type

diff --git a/src/gtk/quicksearch.c b/src/gtk/quicksearch.c
index 4cd6e6f..eadaef1 100644
--- a/src/gtk/quicksearch.c
+++ b/src/gtk/quicksearch.c
@@ -77,7 +77,7 @@ struct _QuickSearch
 	gboolean			 running;
 	gboolean			 has_focus;
 	gboolean			 in_typing;
-	guint				 press_timeout_id;
+	gint				 press_timeout_id;
 
 	GList				*normal_search_strings;
 	GList				*extended_search_strings;

-----------------------------------------------------------------------

Summary of changes:
 src/gtk/quicksearch.c |   10 +++++-----
 src/summaryview.c     |   30 +++++++++++++++++++++++++-----
 src/summaryview.h     |    3 ++-
 3 files changed, 32 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list