Index: calendar/gui/cal-utils.c
===================================================================
--- calendar/gui/cal-utils.c	(revision 0)
+++ calendar/gui/cal-utils.c	(revision 0)
@@ -0,0 +1,168 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* cal-utils.c
+ *
+ * Copyright (C) 2007 Novell, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "cal-utils.h"
+#include "e-util/e-error.h"
+
+#include <string.h>
+
+/**
+ * manage_report_error
+ * Keeps variables private for this function only, not global for the source file.
+ *
+ * @param clear Either clear cache (TRUE), or manage new message (FALSE).
+ * @param parent GtkWindow used to be a parent of the message window,
+ *               if any. Used only when clear is FALSE.
+ * @param msgid ID of the message. Used only when clear is FALSE.
+ **/
+static void
+manage_report_error (gboolean clear, GtkWindow *parent, const char *msgid)
+{
+	static GSList *known = NULL;
+
+	if (clear) {
+		g_slist_foreach (known, (GFunc) g_free, NULL);
+		g_slist_free (known);
+
+		known = NULL;
+	} else {
+		GSList *p;
+
+		g_return_if_fail (msgid != NULL);
+
+		for (p = known; p; p = p->next) {
+			if (strcmp (p->data, msgid) == 0)
+				break;
+		}
+
+		/* means we checked all knowns and didn't find this one */
+		if (!p) {
+			known = g_slist_prepend (known, g_strdup (msgid));
+
+			e_error_run (parent, msgid, NULL);
+		}
+	}
+}
+
+/**
+ * cal_utils_report_error_once
+ *
+ * This reports error message to the user, but only once per run for the msgid.
+ * @param parent GtkWindow to be used as a parent of the message dialog.
+ * @param msgid Identificator of the massage to be shown. It will be used to distinguish
+ *              messages which has been shown and which not, and it will be passed to e_error_run.
+ **/
+void
+cal_utils_report_error_once (GtkWindow *parent, const char *msgid)
+{
+	manage_report_error (FALSE, parent, msgid);
+}
+
+/**
+ * cal_utils_free_report_error_once_cache
+ * Frees the cache of tracked known reports from call of @ref cal_utils_report_error_once.
+ **/
+void
+cal_utils_free_report_error_once_cache (void)
+{
+	manage_report_error (TRUE, NULL, NULL);
+}
+
+/* ------------------------------------------------------------------------- */
+
+/**
+ * cal_utils_add_died_source
+ * Adds a source UID to the list of died sources if it is not there yet.
+ * @param died_sources List of died sources, where to add this one.
+ * @param source_uid UID of the source of our interest.
+ * @return New start of the list of died sources! So be sure you store it.
+ **/
+GSList *
+cal_utils_add_died_source (GSList *died_sources, const char *source_uid)
+{
+	g_return_val_if_fail (source_uid != NULL, died_sources);
+
+	if (cal_utils_is_in_died_sources (died_sources, source_uid) != NULL)
+		return died_sources;
+
+	return g_slist_prepend (died_sources, g_strdup (source_uid));
+}
+
+/**
+ * cal_utils_remove_died_source
+ * Removes a source UID from the list of died sources if it is there.
+ * @param died_sources List of died sources, where to remove this one.
+ * @param source_uid UID of the source of our interest.
+ * @return New start of the list of died sources! So be sure you store it.
+ **/
+GSList *
+cal_utils_remove_died_source (GSList *died_sources, const char *source_uid)
+{
+	GSList *p;
+
+	g_return_val_if_fail (source_uid != NULL, died_sources);
+
+	p  = cal_utils_is_in_died_sources (died_sources, source_uid);
+
+	if (p != NULL) {
+		g_free (p->data);
+		return g_slist_delete_link (died_sources, p);
+	}
+
+	return died_sources;
+}
+
+/**
+ * cal_utils_is_in_died_sources
+ * Looks for a UID of the source in a list.
+ * @param died_sources List of died sources, where to look for.
+ * @param source_uid UID of the source of our interest.
+ * @return When found, then a pointer to the list item in which is that UID or NULL.
+ **/
+GSList *
+cal_utils_is_in_died_sources (GSList *died_sources, const char *source_uid)
+{
+	GSList *l;
+
+	g_return_val_if_fail (source_uid != NULL, NULL);
+	
+	for (l = died_sources; l != NULL; l = l->next) {
+		if (l->data && 0 == strcmp (l->data, source_uid))
+			break;
+	}
+
+	return l;
+}
+
+/**
+ * cal_utils_free_died_sources
+ * Frees whole list of died sources previously allocated with @ref cal_utils_add_died_source.
+ * @param died_sources List of died sources to free.
+ **/
+void
+cal_utils_free_died_sources (GSList *died_sources)
+{
+	if (died_sources == NULL)
+		return;
+
+	g_slist_foreach (died_sources, (GFunc) g_free, NULL);
+	g_slist_free (died_sources);
+}
Index: calendar/gui/cal-utils.h
===================================================================
--- calendar/gui/cal-utils.h	(revision 0)
+++ calendar/gui/cal-utils.h	(revision 0)
@@ -0,0 +1,38 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* cal-utils.h
+ *
+ * Copyright (C) 2007 Novell, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _CAL_UTILS_H
+#define _CAL_UTILS_H
+
+#include <glib.h>
+#include <gtk/gtkwindow.h>
+
+/* Report error only once */
+void cal_utils_report_error_once (GtkWindow *parent, const char *msgid);
+void cal_utils_free_report_error_once_cache (void);
+
+/* Support for tracking died sources */
+GSList *cal_utils_add_died_source    (GSList *died_sources, const char *source_uid);
+GSList *cal_utils_remove_died_source (GSList *died_sources, const char *source_uid);
+GSList *cal_utils_is_in_died_sources (GSList *died_sources, const char *source_uid);
+void    cal_utils_free_died_sources  (GSList *died_sources);
+
+#endif /* _CAL_UTILS_H */
Index: calendar/gui/e-memos.c
===================================================================
--- calendar/gui/e-memos.c	(revision 34779)
+++ calendar/gui/e-memos.c	(working copy)
@@ -58,6 +58,7 @@
 #include "e-cal-component-memo-preview.h"
 #include "e-memos.h"
 #include "common/authentication.h"
+#include "cal-utils.h"
 
 
 /* Private part of the GnomeCalendar structure */
@@ -822,6 +823,8 @@
 
 	source = g_object_ref (e_cal_get_source (client));
 
+	memos_component_add_died_source (NULL, e_source_peek_uid (source));
+
 	priv->clients_list = g_list_remove (priv->clients_list, client);
 	g_hash_table_remove (priv->clients,  e_source_peek_uid (source));
 
@@ -829,8 +832,7 @@
 
 	e_memo_table_set_status_message (E_MEMO_TABLE (e_memos_get_calendar_table (memos)), NULL);
 
-	e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (memos))),
-		     "calendar:memos-crashed", NULL);
+	cal_utils_report_error_once (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (memos))), "calendar:memos-crashed");
 
 	g_object_unref (source);
 }
@@ -854,6 +856,7 @@
 		set_status_message (memos, _("Loading memos"));
 		model = e_memo_table_get_model (E_MEMO_TABLE (priv->memos_view));
 		e_cal_model_add_client (model, ecal);
+		memos_component_remove_died_source (NULL, e_source_peek_uid (source));
 
 		set_timezone (memos);
 		set_status_message (memos, NULL);
Index: calendar/gui/tasks-component.c
===================================================================
--- calendar/gui/tasks-component.c	(revision 34779)
+++ calendar/gui/tasks-component.c	(working copy)
@@ -53,6 +53,7 @@
 #include "misc/e-info-label.h"
 #include "e-util/e-error.h"
 #include "e-util/e-icon-factory.h"
+#include "cal-utils.h"
 
 #define CREATE_TASK_ID               "task"
 #define CREATE_TASK_ASSIGNED_ID      "task-assigned"
@@ -110,6 +111,7 @@
 
 	ESourceList *source_list;
 	GSList *source_selection;
+	GSList *died_sources;
 
 	GList *views;
 
@@ -274,7 +276,8 @@
 static void
 update_uris_for_selection (TasksComponentView *component_view)
 {
-	GSList *selection, *l, *uids_selected = NULL;
+	GSList *selection, *l, *uids_selected = NULL, *old_selected;
+	TasksComponent *component;
 
 	selection = e_source_selector_get_selection (E_SOURCE_SELECTOR (component_view->source_selector));
 
@@ -292,12 +295,26 @@
 		uids_selected = g_slist_append (uids_selected, (char *)e_source_peek_uid (selected_source));
 	}
 
+	component = tasks_component_peek ();
+	old_selected = calendar_config_get_tasks_selected ();
+
+	/* add back those which has been selected before and are closed by crash */
+	for (l = old_selected; l != NULL; l = l->next) {
+		if (cal_utils_is_in_died_sources (component->priv->died_sources, l->data))
+			uids_selected = g_slist_append (uids_selected, l->data);
+	}
+
 	e_source_selector_free_selection (component_view->source_selection);
 	component_view->source_selection = selection;
 
 	/* Save the selection for next time we start up */
 	calendar_config_set_tasks_selected (uids_selected);
 	g_slist_free (uids_selected);
+
+	if (old_selected) {
+		g_slist_foreach (old_selected, (GFunc) g_free, NULL);
+		g_slist_free (old_selected);
+	}
 }
 
 static void
@@ -1401,6 +1418,9 @@
 	g_list_free (priv->notifications);
 	priv->notifications = NULL;
 
+	cal_utils_free_died_sources (priv->died_sources);
+	priv->died_sources = NULL;
+
 	(* G_OBJECT_CLASS (parent_class)->dispose) (object);
 }
 
@@ -1497,4 +1517,46 @@
 	return component->priv->source_list;
 }
 
+/**
+ * tasks_component_add_died_source
+ * We track list of died sources to not save them state (checked/unchecked).
+ * @param component To which component put new source_uid. Can be NULL, in
+ *           that case will be used one from @ref tasks_component_peek.
+ * @param source_uid UID of died source.
+ **/
+void
+tasks_component_add_died_source (TasksComponent *component, const char *source_uid)
+{
+	g_return_if_fail (source_uid != NULL);
+
+	if (!component)
+		component = tasks_component_peek ();
+
+	g_return_if_fail (component != NULL);
+
+	component->priv->died_sources = cal_utils_add_died_source (component->priv->died_sources, source_uid);
+}
+
+/**
+ * tasks_component_remove_died_source
+ * This is a pair function for @ref tasks_component_add_died_source, if we have
+ * source_id in a list of died sources, then this function will remove it from there.
+ * When it isn't there, then this does nothing.
+ * @param component To which component put new source_uid. Can be NULL, in
+ *           that case will be used one from @ref tasks_component_peek.
+ * @param source_uid UID of died source.
+ **/
+void
+tasks_component_remove_died_source (TasksComponent *component, const char *source_uid)
+{
+	g_return_if_fail (source_uid != NULL);
+
+	if (!component)
+		component = tasks_component_peek ();
+
+	g_return_if_fail (component != NULL);
+
+	component->priv->died_sources = cal_utils_remove_died_source (component->priv->died_sources, source_uid);
+}
+
 BONOBO_TYPE_FUNC_FULL (TasksComponent, GNOME_Evolution_Component, PARENT_TYPE, tasks_component)
Index: calendar/gui/tasks-component.h
===================================================================
--- calendar/gui/tasks-component.h	(revision 34779)
+++ calendar/gui/tasks-component.h	(working copy)
@@ -60,4 +60,7 @@
 const char       *tasks_component_peek_config_directory (TasksComponent *component);
 ESourceList      *tasks_component_peek_source_list (TasksComponent *component);
 
+void              tasks_component_add_died_source (TasksComponent *component, const char *source_uid);
+void              tasks_component_remove_died_source (TasksComponent *component, const char *source_uid);
+
 #endif /* _TASKS_COMPONENT_H_ */
Index: calendar/gui/gnome-cal.c
===================================================================
--- calendar/gui/gnome-cal.c	(revision 34779)
+++ calendar/gui/gnome-cal.c	(working copy)
@@ -87,6 +87,7 @@
 #include "e-cal-popup.h"
 #include "e-cal-menu.h"
 #include "e-cal-model-tasks.h"
+#include "cal-utils.h"
 
 /* FIXME glib 2.4 and above has this */
 #ifndef G_MAXINT32
@@ -1936,6 +1937,9 @@
 		gcal->priv = NULL;
 	}
 
+	/* also free cache of reported errors */
+	cal_utils_free_report_error_once_cache ();
+
 	if (GTK_OBJECT_CLASS (gnome_calendar_parent_class)->destroy)
 		(* GTK_OBJECT_CLASS (gnome_calendar_parent_class)->destroy) (object);
 }
@@ -2700,6 +2704,8 @@
 			e_cal_model_add_client (model, ecal);
 		}
 
+		calendar_component_remove_died_source (NULL, e_source_peek_uid (source));
+
 		/* update date navigator query */
 		update_query (gcal);
 
@@ -2712,6 +2718,7 @@
 		g_free (msg);
 
 		e_cal_model_add_client (e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo)), ecal);
+		calendar_component_remove_died_source (NULL, e_source_peek_uid (source));
 
 		e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->todo), NULL, -1);
 		break;
@@ -2720,6 +2727,7 @@
 		e_memo_table_set_status_message (E_MEMO_TABLE (priv->memo), msg);
 		g_free (msg);
 		e_cal_model_add_client (e_memo_table_get_model (E_MEMO_TABLE (priv->memo)), ecal);
+		calendar_component_remove_died_source (NULL, e_source_peek_uid (source));
 		e_memo_table_set_status_message (E_MEMO_TABLE (priv->memo), NULL);
 		break;
 	default:
@@ -2891,6 +2899,8 @@
 	source_type = e_cal_get_source_type (ecal);
 	source = g_object_ref (e_cal_get_source (ecal));
 
+	calendar_component_add_died_source (NULL, e_source_peek_uid (source));
+
 	priv->clients_list[source_type] = g_list_remove (priv->clients_list[source_type], ecal);
 	g_hash_table_remove (priv->clients[source_type], e_source_peek_uid (source));
 
@@ -2924,7 +2934,7 @@
 
 	g_object_unref (source);
 
-	e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))), id, NULL);
+	cal_utils_report_error_once (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))), id);
 }
 
 GtkWidget *
Index: calendar/gui/e-tasks.c
===================================================================
--- calendar/gui/e-tasks.c	(revision 34779)
+++ calendar/gui/e-tasks.c	(working copy)
@@ -59,6 +59,7 @@
 #include "common/authentication.h"
 #include "e-cal-menu.h"
 #include "e-cal-model-tasks.h"
+#include "cal-utils.h"
 
 
 /* Private part of the GnomeCalendar structure */
@@ -938,6 +939,8 @@
 
 	source = g_object_ref (e_cal_get_source (client));
 
+	tasks_component_add_died_source (NULL, e_source_peek_uid (source));
+
 	priv->clients_list = g_list_remove (priv->clients_list, client);
 	g_hash_table_remove (priv->clients,  e_source_peek_uid (source));
 
@@ -945,8 +948,7 @@
 
 	e_calendar_table_set_status_message (E_CALENDAR_TABLE (e_tasks_get_calendar_table (tasks)), NULL, -1);
 
-	e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tasks))),
-		     "calendar:tasks-crashed", NULL);
+	cal_utils_report_error_once (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tasks))), "calendar:tasks-crashed");
 
 	g_object_unref (source);
 }
@@ -970,6 +972,7 @@
 		set_status_message (tasks, _("Loading tasks"));
 		model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
 		e_cal_model_add_client (model, ecal);
+		tasks_component_remove_died_source (NULL, e_source_peek_uid (source));
 
 		set_status_message (tasks, NULL);
 		break;
Index: calendar/gui/Makefile.am
===================================================================
--- calendar/gui/Makefile.am	(revision 34779)
+++ calendar/gui/Makefile.am	(working copy)
@@ -87,6 +87,8 @@
 libevolution_calendar_la_SOURCES =		\
 	$(IDL_GENERATED)			\
 	$(MARSHAL_GENERATED)			\
+	cal-utils.c				\
+	cal-utils.h				\
 	cal-search-bar.c			\
 	cal-search-bar.h			\
 	calendar-config.c			\
Index: calendar/gui/calendar-component.c
===================================================================
--- calendar/gui/calendar-component.c	(revision 34779)
+++ calendar/gui/calendar-component.c	(working copy)
@@ -57,6 +57,7 @@
 #include "e-util/e-icon-factory.h"
 #include "e-cal-menu.h"
 #include "e-cal-popup.h"
+#include "cal-utils.h"
 
 /* IDs for user creatable items */
 #define CREATE_EVENT_ID        "event"
@@ -120,6 +121,7 @@
 	ESourceList *source_list;
 	ESourceList *task_source_list;
 	ESourceList *memo_source_list;
+	GSList *died_sources;
 
 	GList *views;
 
@@ -357,7 +359,8 @@
 static void
 update_uris_for_selection (CalendarComponentView *component_view)
 {
-	GSList *selection, *l, *uids_selected = NULL;
+	GSList *selection, *l, *uids_selected = NULL, *old_selected;
+	CalendarComponent *component;
 
 	selection = e_source_selector_get_selection (E_SOURCE_SELECTOR (component_view->source_selector));
 
@@ -378,9 +381,23 @@
 	e_source_selector_free_selection (component_view->source_selection);
 	component_view->source_selection = selection;
 
+	component = calendar_component_peek ();
+	old_selected = calendar_config_get_calendars_selected ();
+
+	/* add back those which has been selected before and are closed by crash */
+	for (l = old_selected; l != NULL; l = l->next) {
+		if (cal_utils_is_in_died_sources (component->priv->died_sources, l->data))
+			uids_selected = g_slist_append (uids_selected, l->data);
+	}
+
 	/* Save the selection for next time we start up */
 	calendar_config_set_calendars_selected (uids_selected);
 	g_slist_free (uids_selected);
+
+	if (old_selected) {
+		g_slist_foreach (old_selected, (GFunc) g_free, NULL);
+		g_slist_free (old_selected);
+	}
 }
 
 static void
@@ -1677,6 +1694,9 @@
 	g_list_free (priv->notifications);
 	priv->notifications = NULL;
 
+	cal_utils_free_died_sources (priv->died_sources);
+	priv->died_sources = NULL;
+
 	(* G_OBJECT_CLASS (parent_class)->dispose) (object);
 }
 
@@ -1789,4 +1809,46 @@
 	return component->priv->source_list;
 }
 
+/**
+ * calendar_component_add_died_source
+ * We track list of died sources to not save them state (checked/unchecked).
+ * @param component To which component put new source_uid. Can be NULL, in
+ *           that case will be used one from @ref calendar_component_peek.
+ * @param source_uid UID of died source.
+ **/
+void
+calendar_component_add_died_source (CalendarComponent *component, const char *source_uid)
+{
+	g_return_if_fail (source_uid != NULL);
+
+	if (!component)
+		component = calendar_component_peek ();
+
+	g_return_if_fail (component != NULL);
+
+	component->priv->died_sources = cal_utils_add_died_source (component->priv->died_sources, source_uid);
+}
+
+/**
+ * calendar_component_remove_died_source
+ * This is a pair function for @ref calendar_component_add_died_source, if we have
+ * source_id in a list of died sources, then this function will remove it from there.
+ * When it isn't there, then this does nothing.
+ * @param component To which component put new source_uid. Can be NULL, in
+ *           that case will be used one from @ref calendar_component_peek.
+ * @param source_uid UID of died source.
+ **/
+void
+calendar_component_remove_died_source (CalendarComponent *component, const char *source_uid)
+{
+	g_return_if_fail (source_uid != NULL);
+
+	if (!component)
+		component = calendar_component_peek ();
+
+	g_return_if_fail (component != NULL);
+
+	component->priv->died_sources = cal_utils_remove_died_source (component->priv->died_sources, source_uid);
+}
+
 BONOBO_TYPE_FUNC_FULL (CalendarComponent, GNOME_Evolution_Component, PARENT_TYPE, calendar_component)
Index: calendar/gui/calendar-component.h
===================================================================
--- calendar/gui/calendar-component.h	(revision 34779)
+++ calendar/gui/calendar-component.h	(working copy)
@@ -61,5 +61,7 @@
 const char       *calendar_component_peek_config_directory  (CalendarComponent *component);
 ESourceList      *calendar_component_peek_source_list       (CalendarComponent *component);
 
+void              calendar_component_add_died_source (CalendarComponent *component, const char *source_uid);
+void              calendar_component_remove_died_source (CalendarComponent *component, const char *source_uid);
 
 #endif /* _CALENDAR_COMPONENT_H_ */
Index: calendar/gui/memos-component.c
===================================================================
--- calendar/gui/memos-component.c	(revision 34779)
+++ calendar/gui/memos-component.c	(working copy)
@@ -54,6 +54,7 @@
 #include "e-util/e-icon-factory.h"
 #include "e-util/e-error.h"
 #include "calendar-component.h"
+#include "cal-utils.h"
 
 #define CREATE_MEMO_ID               "memo"
 #define CREATE_SHARED_MEMO_ID	     "shared-memo"
@@ -111,6 +112,7 @@
 
 	ESourceList *source_list;
 	GSList *source_selection;
+	GSList *died_sources;
 
 	GList *views;
 
@@ -278,7 +280,8 @@
 static void
 update_uris_for_selection (MemosComponentView *component_view)
 {
-	GSList *selection, *l, *uids_selected = NULL;
+	GSList *selection, *l, *uids_selected = NULL, *old_selected;
+	MemosComponent *component;
 
 	selection = e_source_selector_get_selection (E_SOURCE_SELECTOR (component_view->source_selector));
 
@@ -299,9 +302,23 @@
 	e_source_selector_free_selection (component_view->source_selection);
 	component_view->source_selection = selection;
 
+	component = memos_component_peek ();
+	old_selected = calendar_config_get_memos_selected ();
+
+	/* add back those which has been selected before and are closed by crash */
+	for (l = old_selected; l != NULL; l = l->next) {
+		if (cal_utils_is_in_died_sources (component->priv->died_sources, l->data))
+			uids_selected = g_slist_append (uids_selected, l->data);
+	}
+
 	/* Save the selection for next time we start up */
 	calendar_config_set_memos_selected (uids_selected);
 	g_slist_free (uids_selected);
+
+	if (old_selected) {
+		g_slist_foreach (old_selected, (GFunc) g_free, NULL);
+		g_slist_free (old_selected);
+	}
 }
 
 static void
@@ -1341,6 +1358,9 @@
 	g_list_free (priv->notifications);
 	priv->notifications = NULL;
 
+	cal_utils_free_died_sources (priv->died_sources);
+	priv->died_sources = NULL;
+
 	(* G_OBJECT_CLASS (parent_class)->dispose) (object);
 }
 
@@ -1436,4 +1456,46 @@
 	return component->priv->source_list;
 }
 
+/**
+ * memos_component_add_died_source
+ * We track list of died sources to not save them state (checked/unchecked).
+ * @param component To which component put new source_uid. Can be NULL, in
+ *           that case will be used one from @ref memos_component_peek.
+ * @param source_uid UID of died source.
+ **/
+void
+memos_component_add_died_source (MemosComponent *component, const char *source_uid)
+{
+	g_return_if_fail (source_uid != NULL);
+
+	if (!component)
+		component = memos_component_peek ();
+
+	g_return_if_fail (component != NULL);
+
+	component->priv->died_sources = cal_utils_add_died_source (component->priv->died_sources, source_uid);
+}
+
+/**
+ * memos_component_remove_died_source
+ * This is a pair function for @ref memos_component_add_died_source, if we have
+ * source_id in a list of died sources, then this function will remove it from there.
+ * When it isn't there, then this does nothing.
+ * @param component To which component put new source_uid. Can be NULL, in
+ *           that case will be used one from @ref memos_component_peek.
+ * @param source_uid UID of died source.
+ **/
+void
+memos_component_remove_died_source (MemosComponent *component, const char *source_uid)
+{
+	g_return_if_fail (source_uid != NULL);
+
+	if (!component)
+		component = memos_component_peek ();
+
+	g_return_if_fail (component != NULL);
+
+	component->priv->died_sources = cal_utils_remove_died_source (component->priv->died_sources, source_uid);
+}
+
 BONOBO_TYPE_FUNC_FULL (MemosComponent, GNOME_Evolution_Component, PARENT_TYPE, memos_component)
Index: calendar/gui/memos-component.h
===================================================================
--- calendar/gui/memos-component.h	(revision 34779)
+++ calendar/gui/memos-component.h	(working copy)
@@ -61,4 +61,7 @@
 const char       *memos_component_peek_config_directory (MemosComponent *component);
 ESourceList      *memos_component_peek_source_list (MemosComponent *component);
 
+void              memos_component_add_died_source (MemosComponent *component, const char *source_uid);
+void              memos_component_remove_died_source (MemosComponent *component, const char *source_uid);
+
 #endif /* _MEMOS_COMPONENT_H_ */
Index: calendar/ChangeLog
===================================================================
--- calendar/ChangeLog	(revision 34779)
+++ calendar/ChangeLog	(working copy)
@@ -1,3 +1,39 @@
+2008-01-08  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #305322
+
+	* gui/Makefile.am:
+	* gui/cal-utils.h:
+	* gui/cal-utils.c: New source files for calendar utility functions.
+	* gui/gnome-cal.c: (gnome_calendar_destroy):
+	Free cache from report_error_once together with this component.
+	* gui/gnome-cal.c: (backend_died_cb):
+	* gui/e-tasks.c: (backend_died_cb):
+	* gui/e-memos.c: (backend_died_cb): Remember died sources in the
+	component and show the error message only once.
+	* gui/gnome-cal.c: (client_cal_opened_cb):
+	* gui/e-tasks.c: (client_cal_opened_cb):
+	* gui/e-memos.c: (client_cal_opened_cb): Ensure the reopened source
+	is not tracked as died when it became opened.
+	* gui/calendar-component.c: (update_uris_for_selection):
+	* gui/tasks-component.c: (update_uris_for_selection):
+	* gui/memos-component.c: (update_uris_for_selection):
+	Always store died sources in gconf, so the next start of evolution
+	they will be opened.
+	* gui/calendar-component.h:
+	* gui/calendar-component.c: (struct _CalendarComponentPrivate),
+	(impl_dispose), (calendar_component_add_died_source),
+	(calendar_component_remove_died_source):
+	* gui/tasks-component.h:
+	* gui/tasks-component.c: (struct _TasksComponentPrivate),
+	(impl_dispose), (tasks_component_add_died_source),
+	(tasks_component_remove_died_source):
+	* gui/memos-component.h:
+	* gui/memos-component.c: (struct _MemosComponentPrivate),
+	(impl_dispose), (memos_component_add_died_source),
+	(memos_component_remove_died_source):
+	Track died sources in the component.
+
 2008-01-06  Michael Monreal  <michael.monreal@gmx.net>
 
 	** Fix for bug #492188
