[gnome-calendar] manager: initial implementation of GcalManager::save_source method
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] manager: initial implementation of GcalManager::save_source method
- Date: Mon, 25 May 2015 16:48:40 +0000 (UTC)
commit 18fa2059167db3e56f1b9bf5ecddf4fdc1e716e7
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Mon Feb 9 16:56:12 2015 -0200
manager: initial implementation of GcalManager::save_source method
src/gcal-manager.c | 27 +++++++++++++++++++++++++++
src/gcal-manager.h | 3 +++
2 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-manager.c b/src/gcal-manager.c
index 0258970..08979b8 100644
--- a/src/gcal-manager.c
+++ b/src/gcal-manager.c
@@ -1212,6 +1212,33 @@ gcal_manager_disable_source (GcalManager *manager,
g_settings_set_strv (priv->settings, "disabled-sources", (const gchar * const *) priv->disabled_sources);
}
+/**
+ * gcal_manager_save_source:
+ * @manager: a #GcalManager
+ * @source: the target ESource
+ *
+ * Commit the given ESource.
+ */
+void
+gcal_manager_save_source (GcalManager *manager,
+ ESource *source)
+{
+ GcalManagerPrivate *priv;
+ GError *error;
+
+ priv = gcal_manager_get_instance_private (manager);
+ error = NULL;
+
+ e_source_registry_commit_source_sync (priv->source_registry, source, NULL, &error);
+
+ if (error != NULL)
+ {
+ /* FIXME: Notify the user somehow */
+ g_warning ("Error saving source: %s", error->message);
+ g_error_free (error);
+ }
+}
+
gboolean
gcal_manager_source_enabled (GcalManager *manager,
ESource *source)
diff --git a/src/gcal-manager.h b/src/gcal-manager.h
index b547506..ff1995d 100644
--- a/src/gcal-manager.h
+++ b/src/gcal-manager.h
@@ -113,6 +113,9 @@ void gcal_manager_enable_source (GcalManager *manager
void gcal_manager_disable_source (GcalManager *manager,
ESource *source);
+void gcal_manager_save_source (GcalManager *manager,
+ ESource *source);
+
gboolean gcal_manager_source_enabled (GcalManager *manager,
ESource *source);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]