aboutsummaryrefslogtreecommitdiff
path: root/libindicate
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-01-14 16:31:38 -0600
committerTed Gould <ted@canonical.com>2009-01-14 16:31:38 -0600
commitbda3bbf9c507cf13f15659522c6383d11930f29f (patch)
tree19bd6379213dd3b24d8c990ca8def8a6ded82842 /libindicate
parentc14592279f3feaad53e397155ecc515e5623d940 (diff)
downloadlibayatana-indicator-bda3bbf9c507cf13f15659522c6383d11930f29f.tar.gz
libayatana-indicator-bda3bbf9c507cf13f15659522c6383d11930f29f.tar.bz2
libayatana-indicator-bda3bbf9c507cf13f15659522c6383d11930f29f.zip
Who the hell would design an API that passes in arrays of strings differently
than it passes them out. What an insane idea. Oh yeah, properties work.
Diffstat (limited to 'libindicate')
-rw-r--r--libindicate/server.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libindicate/server.c b/libindicate/server.c
index fe32f57..076433a 100644
--- a/libindicate/server.c
+++ b/libindicate/server.c
@@ -403,13 +403,41 @@ get_indicator_property (IndicateServer * server, guint id, gchar * property, gch
static gboolean
get_indicator_property_group (IndicateServer * server, guint id, GPtrArray * properties, GPtrArray ** value, GError **error)
{
+ IndicateIndicator * indicator = get_indicator(server, id, error);
+ if (indicator == NULL) {
+ return FALSE;
+ }
+
+ GPtrArray * array = g_ptr_array_new();
+ int i;
+ for (i = 0; i < properties->len; i++) {
+ const gchar * val = indicate_indicator_get_property(indicator, g_ptr_array_index(properties, i));
+ if (val != NULL) {
+ g_ptr_array_add(array, g_strdup(val));
+ } else {
+ g_ptr_array_add(array, g_strdup(""));
+ }
+ }
+ g_ptr_array_add(array, NULL);
+ *value = (GPtrArray *)g_ptr_array_free(array, FALSE);
+ return TRUE;
}
static gboolean
get_indicator_properties (IndicateServer * server, guint id, GPtrArray ** properties, GError **error)
{
+ IndicateIndicator * indicator = get_indicator(server, id, error);
+ if (indicator == NULL) {
+ return FALSE;
+ }
+
+ GPtrArray * array = indicate_indicator_list_properties(indicator);
+ g_ptr_array_add(array, NULL);
+ *properties = (gchar **)g_ptr_array_free(array, FALSE);
+
+ return TRUE;
}
static gboolean