[gnome-calendar/ui-rewrite] gcal-manager: add API to get default calendar



commit 530ea265c1b3eedfe6c101c4cbc22355040b8c77
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Wed Jul 3 20:16:48 2013 -0400

    gcal-manager: add API to get default calendar

 src/gcal-manager.c |   17 +++++++++++++++++
 src/gcal-manager.h |    2 ++
 2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-manager.c b/src/gcal-manager.c
index 41c2ce9..e96961c 100644
--- a/src/gcal-manager.c
+++ b/src/gcal-manager.c
@@ -1144,6 +1144,23 @@ gcal_manager_add_source (GcalManager *manager,
   return e_source_dup_uid (source);
 }
 
+gchar*
+gcal_manager_get_default_source (GcalManager *manager)
+{
+  GcalManagerPrivate *priv;
+
+  ESource *edefault;
+  gchar *source_uid;
+
+  priv = gcal_manager_get_instance_private (manager);
+
+  edefault = e_source_registry_ref_default_calendar (priv->source_registry);
+  source_uid = e_source_dup_uid (edefault);
+
+  g_object_unref (edefault);
+  return source_uid;
+}
+
 const gchar*
 gcal_manager_get_source_name (GcalManager *manager,
                               const gchar *source_uid)
diff --git a/src/gcal-manager.h b/src/gcal-manager.h
index 501c1ff..4c9568c 100644
--- a/src/gcal-manager.h
+++ b/src/gcal-manager.h
@@ -67,6 +67,8 @@ gchar*         gcal_manager_add_source              (GcalManager        *manager
                                                      const gchar        *backend,
                                                      const gchar        *color);
 
+gchar*         gcal_manager_get_default_source      (GcalManager        *manager);
+
 const gchar*   gcal_manager_get_source_name         (GcalManager        *manager,
                                                      const gchar        *source_uid);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]