[gnome-calendar/calendar-management] manager: don't call GcalManager::remove_source on an invalid source
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/calendar-management] manager: don't call GcalManager::remove_source on an invalid source
- Date: Thu, 5 Feb 2015 20:45:20 +0000 (UTC)
commit a547ba96e83075c7a757b875283d268efbc5dd3a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Feb 5 18:19:06 2015 -0200
manager: don't call GcalManager::remove_source on an invalid source
src/gcal-manager.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/src/gcal-manager.c b/src/gcal-manager.c
index c7c216e..6ff0cdb 100644
--- a/src/gcal-manager.c
+++ b/src/gcal-manager.c
@@ -504,14 +504,16 @@ on_source_removed (GObject *source,
if (!e_source_remove_finish (E_SOURCE (source), result, &error))
{
+ /**
+ * If the source was not removed,
+ * readd it.
+ */
+ load_source (GCAL_MANAGER (user_data), E_SOURCE (source));
+
/* FIXME: Notify the user somehow */
g_warning ("Error removing source: %s", error->message);
g_error_free (error);
}
- else
- {
- remove_source (GCAL_MANAGER (user_data), E_SOURCE (source));
- }
}
void
@@ -966,6 +968,12 @@ void
gcal_manager_remove_source (GcalManager *manager,
ESource *source)
{
+ /**
+ * GcalManager::remove_source will properly setup
+ * the signals and subscribers.
+ */
+ remove_source (GCAL_MANAGER (user_data), E_SOURCE (source));
+
e_source_remove (source, NULL, on_source_removed, manager);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]