[gnome-calendar] manager: implement GcalManager::query_client_data
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] manager: implement GcalManager::query_client_data
- Date: Mon, 25 May 2015 16:50:02 +0000 (UTC)
commit c48edbd68262856141f72ff7c3b1f1365df08a7b
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue Feb 10 13:14:11 2015 -0200
manager: implement GcalManager::query_client_data
src/gcal-manager.c | 28 ++++++++++++++++++++++++++++
src/gcal-manager.h | 4 ++++
2 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-manager.c b/src/gcal-manager.c
index e44e5b5..63920ca 100644
--- a/src/gcal-manager.c
+++ b/src/gcal-manager.c
@@ -1089,6 +1089,34 @@ gcal_manager_set_query (GcalManager *manager,
}
/**
+ * gcal_manager_query_client_data:
+ *
+ * Queries for a specific data field of
+ * the { link ECalClient}.
+ *
+ * Returns: (Transfer none) a string representing the retrieved value, or NULL.
+ */
+gchar*
+gcal_manager_query_client_data (GcalManager *manager,
+ ESource *source,
+ const gchar *field)
+{
+ GcalManagerPrivate *priv;
+ GcalManagerUnit *unit;
+ gchar *out;
+
+ priv = gcal_manager_get_instance_private (manager);
+ unit = g_hash_table_lookup (priv->clients, source);
+
+ if (unit == NULL)
+ return NULL;
+
+ g_object_get (unit->client, field, &out, NULL);
+
+ return out;
+}
+
+/**
* gcal_manager_add_source:
* @manager: a #GcalManager
* @base_uri: URI defining the ESourceGroup the client will belongs
diff --git a/src/gcal-manager.h b/src/gcal-manager.h
index 6b1bf77..e12d01b 100644
--- a/src/gcal-manager.h
+++ b/src/gcal-manager.h
@@ -105,6 +105,10 @@ void gcal_manager_set_search_subscriber (GcalManager *manager
void gcal_manager_set_query (GcalManager *manager,
const gchar *query);
+gchar* gcal_manager_query_client_data (GcalManager *manager,
+ ESource *source,
+ const gchar *field);
+
gchar* gcal_manager_add_source (GcalManager *manager,
const gchar *name,
const gchar *backend,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]