Blame SOURCES/evolution-3.28.5-deselect-task-memo-list.patch

5bdb4f
diff -up evolution-3.28.5/src/modules/calendar/e-cal-base-shell-sidebar.c.deselect-task-memo-list evolution-3.28.5/src/modules/calendar/e-cal-base-shell-sidebar.c
5bdb4f
--- evolution-3.28.5/src/modules/calendar/e-cal-base-shell-sidebar.c.deselect-task-memo-list	2018-07-30 15:37:05.000000000 +0200
5bdb4f
+++ evolution-3.28.5/src/modules/calendar/e-cal-base-shell-sidebar.c	2018-10-01 12:20:09.864492453 +0200
5bdb4f
@@ -296,6 +296,7 @@ typedef struct _OpenClientData {
5bdb4f
 	ECalBaseShellSidebar *sidebar;
5bdb4f
 	ESource *source;
5bdb4f
 	EClient *client;
5bdb4f
+	gboolean was_cancelled;
5bdb4f
 } OpenClientData;
5bdb4f
 
5bdb4f
 static void
5bdb4f
@@ -304,9 +305,14 @@ open_client_data_free (gpointer pdata)
5bdb4f
 	OpenClientData *data = pdata;
5bdb4f
 
5bdb4f
 	if (data) {
5bdb4f
+		/* To free the cancellable in the 'value' pair, which is useless now */
5bdb4f
+		g_hash_table_insert (data->sidebar->priv->selected_uids,
5bdb4f
+			g_strdup (e_source_get_uid (data->source)),
5bdb4f
+			NULL);
5bdb4f
+
5bdb4f
 		if (data->client) {
5bdb4f
 			g_signal_emit (data->sidebar, signals[CLIENT_OPENED], 0, data->client);
5bdb4f
-		} else {
5bdb4f
+		} else if (!data->was_cancelled) {
5bdb4f
 			ESourceSelector *selector = e_cal_base_shell_sidebar_get_selector (data->sidebar);
5bdb4f
 			e_source_selector_unselect_source (selector, data->source);
5bdb4f
 		}
5bdb4f
@@ -333,6 +339,7 @@ e_cal_base_shell_sidebar_open_client_thr
5bdb4f
 	selector = E_CLIENT_SELECTOR (e_cal_base_shell_sidebar_get_selector (data->sidebar));
5bdb4f
 	data->client = e_client_selector_get_client_sync (
5bdb4f
 		selector, data->source, TRUE, (guint32) -1, cancellable, &local_error);
5bdb4f
+	data->was_cancelled = g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED);
5bdb4f
 
5bdb4f
 	e_util_propagate_open_source_job_error (job_data, data->extension_name, local_error, error);
5bdb4f
 }
5bdb4f
@@ -350,6 +357,10 @@ e_cal_base_shell_sidebar_ensure_source_o
5bdb4f
 	g_return_if_fail (E_IS_CAL_BASE_SHELL_SIDEBAR (sidebar));
5bdb4f
 	g_return_if_fail (E_IS_SOURCE (source));
5bdb4f
 
5bdb4f
+	/* Skip it when it's already opening or opened */
5bdb4f
+	if (g_hash_table_contains (sidebar->priv->selected_uids, e_source_get_uid (source)))
5bdb4f
+		return;
5bdb4f
+
5bdb4f
 	shell_view = e_shell_sidebar_get_shell_view (E_SHELL_SIDEBAR (sidebar));
5bdb4f
 
5bdb4f
 	switch (e_cal_base_shell_view_get_source_type (shell_view)) {