[evolution-data-server] Add e_source_registry_ref_builtin_proxy().



commit 77470629823253125fb2da8e08b9b01e480b4f0a
Author: Matthew Barnes <mbarnes redhat com>
Date:   Tue Oct 8 21:30:07 2013 -0400

    Add e_source_registry_ref_builtin_proxy().
    
    Returns the built-in proxy profile ESource.

 .../libedataserver/libedataserver-sections.txt     |    1 +
 libedataserver/e-source-registry.c                 |   31 ++++++++++++++++++++
 libedataserver/e-source-registry.h                 |    2 +
 3 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/libedataserver/libedataserver-sections.txt 
b/docs/reference/libedataserver/libedataserver-sections.txt
index a6736f3..201a8c1 100644
--- a/docs/reference/libedataserver/libedataserver-sections.txt
+++ b/docs/reference/libedataserver/libedataserver-sections.txt
@@ -945,6 +945,7 @@ e_source_registry_ref_builtin_address_book
 e_source_registry_ref_builtin_calendar
 e_source_registry_ref_builtin_mail_account
 e_source_registry_ref_builtin_memo_list
+e_source_registry_ref_builtin_proxy
 e_source_registry_ref_builtin_task_list
 e_source_registry_ref_default_address_book
 e_source_registry_set_default_address_book
diff --git a/libedataserver/e-source-registry.c b/libedataserver/e-source-registry.c
index ed10804..994097a 100644
--- a/libedataserver/e-source-registry.c
+++ b/libedataserver/e-source-registry.c
@@ -76,6 +76,7 @@
 #define E_SOURCE_BUILTIN_CALENDAR_UID          "system-calendar"
 #define E_SOURCE_BUILTIN_MAIL_ACCOUNT_UID      "local"
 #define E_SOURCE_BUILTIN_MEMO_LIST_UID         "system-memo-list"
+#define E_SOURCE_BUILTIN_PROXY_UID             "system-proxy"
 #define E_SOURCE_BUILTIN_TASK_LIST_UID         "system-task-list"
 
 /* GSettings keys for default data sources. */
@@ -3325,6 +3326,36 @@ e_source_registry_ref_builtin_memo_list (ESourceRegistry *registry)
 }
 
 /**
+ * e_source_registry_ref_builtin_proxy:
+ * @registry: an #ESourceRegistry
+ *
+ * Returns the built-in proxy profile #ESource.
+ *
+ * This #ESource is always present and makes for a safe fallback.
+ *
+ * The returned #ESource is referenced for thread-safety and must be
+ * unreferenced with g_object_unref() when finished with it.
+ *
+ * Returns: (transfer full): the built-in proxy profile #ESource
+ *
+ * Since: 3.12
+ **/
+ESource *
+e_source_registry_ref_builtin_proxy (ESourceRegistry *registry)
+{
+       ESource *source;
+       const gchar *uid;
+
+       g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), NULL);
+
+       uid = E_SOURCE_BUILTIN_PROXY_UID;
+       source = e_source_registry_ref_source (registry, uid);
+       g_return_val_if_fail (source != NULL, NULL);
+
+       return source;
+}
+
+/**
  * e_source_registry_ref_builtin_task_list:
  * @registry: an #ESourceRegistry
  *
diff --git a/libedataserver/e-source-registry.h b/libedataserver/e-source-registry.h
index 0e58ce3..b01f947 100644
--- a/libedataserver/e-source-registry.h
+++ b/libedataserver/e-source-registry.h
@@ -169,6 +169,8 @@ ESource *   e_source_registry_ref_builtin_mail_account
                                                (ESourceRegistry *registry);
 ESource *      e_source_registry_ref_builtin_memo_list
                                                (ESourceRegistry *registry);
+ESource *      e_source_registry_ref_builtin_proxy
+                                               (ESourceRegistry *registry);
 ESource *      e_source_registry_ref_builtin_task_list
                                                (ESourceRegistry *registry);
 


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