[gnome-calendar] manager: get all connected sources
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] manager: get all connected sources
- Date: Mon, 22 Dec 2014 13:43:08 +0000 (UTC)
commit 073719ef35bd83c708b6f518df5f30430b71dd0b
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Sun Dec 21 23:24:59 2014 -0500
manager: get all connected sources
Added ::get_sources_connected API to retrieve a list of every source the
application has connected, no matter whether they are enabled or not.
Use ::get_sources_connected on calendars menu in GcalWindow to enable
disabled sources.
src/gcal-manager.c | 20 ++++++++++++++++++--
src/gcal-manager.h | 2 ++
src/gcal-window.c | 2 +-
3 files changed, 21 insertions(+), 3 deletions(-)
---
diff --git a/src/gcal-manager.c b/src/gcal-manager.c
index e453e70..ced12ae 100644
--- a/src/gcal-manager.c
+++ b/src/gcal-manager.c
@@ -635,8 +635,7 @@ gcal_manager_new_with_settings (GSettings *settings)
*
* Retrieve a list of the enabled sources used in the application.
*
- * Returns: (Transfer full) a { link GList} object
- * to be freed with g_list_free()
+ * Returns: (Transfer full) a { link GList} object to be freed with g_list_free()
**/
GList*
gcal_manager_get_sources (GcalManager *manager)
@@ -660,6 +659,23 @@ gcal_manager_get_sources (GcalManager *manager)
}
/**
+ * gcal_manager_get_sources_connected:
+ * @manager:
+ *
+ * Returns a { link GList} with every source connected on the app, whether they are enabled or not.
+ *
+ * Returns: (Transfer full) a { link GList} object to be freed with g_list_free()
+ **/
+GList*
+gcal_manager_get_sources_connected (GcalManager *manager)
+{
+ GcalManagerPrivate *priv;
+
+ priv = gcal_manager_get_instance_private (manager);
+ return g_hash_table_get_keys (priv->clients);
+}
+
+/**
* gcal_manager_get_default_source:
* @manager: App singleton { link GcalManager} instance
*
diff --git a/src/gcal-manager.h b/src/gcal-manager.h
index f0f13ac..a4a2964 100644
--- a/src/gcal-manager.h
+++ b/src/gcal-manager.h
@@ -63,6 +63,8 @@ GcalManager* gcal_manager_new_with_settings (GSettings *setting
GList* gcal_manager_get_sources (GcalManager *manager);
+GList* gcal_manager_get_sources_connected (GcalManager *manager);
+
ESource* gcal_manager_get_default_source (GcalManager *manager);
icaltimezone* gcal_manager_get_system_timezone (GcalManager *manager);
diff --git a/src/gcal-window.c b/src/gcal-window.c
index d2f2567..aa1aeb9 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -776,7 +776,7 @@ on_calendar_toggled (GSimpleAction *action,
/* lookup source */
source = NULL;
- l = gcal_manager_get_sources (priv->manager);
+ l = gcal_manager_get_sources_connected (priv->manager);
for (aux = l; aux != NULL; aux = aux->next)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]