[gnome-calendar/calendar-management] manager: implement GcalManager::is_source_enabled function
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/calendar-management] manager: implement GcalManager::is_source_enabled function
- Date: Tue, 3 Feb 2015 18:48:38 +0000 (UTC)
commit 837c1bc32f671efa7938cdfc6ce22fb88ec5d5b2
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue Feb 3 16:48:29 2015 -0200
manager: implement GcalManager::is_source_enabled function
src/gcal-manager.c | 22 ++++++++++++++++++++++
src/gcal-manager.h | 3 +++
2 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-manager.c b/src/gcal-manager.c
index 3f0379e..10652b7 100644
--- a/src/gcal-manager.c
+++ b/src/gcal-manager.c
@@ -916,6 +916,28 @@ gcal_manager_disable_source (GcalManager *manager,
g_settings_set_strv (priv->settings, "disabled-sources", (const gchar * const *) priv->disabled_sources);
}
+/**
+ * gcal_manager_is_source_enabled:
+ * @manager: a #GcalManager
+ * @source: the target ESource
+ *
+ * Disable the given ESource.
+ *
+ * Returns: #TRUE if @source is enable, #FALSE otherwise.
+ */
+void
+gcal_manager_is_source_enabled (GcalManager *manager,
+ ESource *source)
+{
+ GcalManagerPrivate *priv;
+ GcalManagerUnit *unit;
+
+ priv = gcal_manager_get_instance_private (manager);
+ unit = g_hash_table_lookup (priv->clients, source);
+
+ return unit->enabled;
+}
+
void
gcal_manager_refresh (GcalManager *manager)
{
diff --git a/src/gcal-manager.h b/src/gcal-manager.h
index ab00258..a11987a 100644
--- a/src/gcal-manager.h
+++ b/src/gcal-manager.h
@@ -100,6 +100,9 @@ void gcal_manager_enable_source (GcalManager *manager
void gcal_manager_disable_source (GcalManager *manager,
ESource *source);
+void gcal_manager_is_source_enabled (GcalManager *manager,
+ ESource *source);
+
void gcal_manager_refresh (GcalManager *manager);
gboolean gcal_manager_is_client_writable (GcalManager *manager,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]