[Telepathy-commits] [telepathy-salut/master] Implement 'allowed' in terms of 'required' and 'optional'

Will Thompson will.thompson at collabora.co.uk
Thu Oct 23 07:30:34 PDT 2008


---
 src/conn-requests.c |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/conn-requests.c b/src/conn-requests.c
index 8773b48..b182e27 100644
--- a/src/conn-requests.c
+++ b/src/conn-requests.c
@@ -844,6 +844,22 @@ get_requestables_foreach (SalutChannelManager *manager,
   GPtrArray *details = user_data;
   GValueArray *requestable = g_value_array_new (3);
   GValue *value;
+  GPtrArray *allowed;
+  const gchar * const *iter;
+
+  allowed = g_ptr_array_new ();
+
+  for (iter = required_properties;
+       iter != NULL && *iter != NULL;
+       iter++)
+    g_ptr_array_add (allowed, g_strdup (*iter));
+
+  for (iter = optional_properties;
+       iter != NULL && *iter != NULL;
+       iter++)
+    g_ptr_array_add (allowed, g_strdup (*iter));
+
+  g_ptr_array_add (allowed, NULL);
 
   g_value_array_append (requestable, NULL);
   value = g_value_array_get_nth (requestable, 0);
@@ -853,12 +869,7 @@ get_requestables_foreach (SalutChannelManager *manager,
   g_value_array_append (requestable, NULL);
   value = g_value_array_get_nth (requestable, 1);
   g_value_init (value, G_TYPE_STRV);
-  g_value_set_boxed (value, required_properties);
-
-  g_value_array_append (requestable, NULL);
-  value = g_value_array_get_nth (requestable, 2);
-  g_value_init (value, G_TYPE_STRV);
-  g_value_set_boxed (value, optional_properties);
+  g_value_take_boxed (value, g_ptr_array_free (allowed, FALSE));
 
   g_ptr_array_add (details, requestable);
 }
-- 
1.5.6.5




More information about the Telepathy-commits mailing list