[Galago-commits] r2331 - in trunk/galago-daemon: . src
galago-commits at freedesktop.org
galago-commits at freedesktop.org
Sun Nov 20 01:21:54 PST 2005
Author: chipx86
Date: 2005-11-20 01:21:47 -0800 (Sun, 20 Nov 2005)
New Revision: 2331
Modified:
trunk/galago-daemon/ChangeLog
trunk/galago-daemon/src/person.c
Log:
In Person.GetProperty, return the value in a variant container.
Modified: trunk/galago-daemon/ChangeLog
===================================================================
--- trunk/galago-daemon/ChangeLog 2005-11-20 09:21:21 UTC (rev 2330)
+++ trunk/galago-daemon/ChangeLog 2005-11-20 09:21:47 UTC (rev 2331)
@@ -1,3 +1,8 @@
+Sun Nov 20 01:21:23 PST 2005 Christian Hammond <chipx86 at chipx86.com>
+
+ * src/person.c:
+ - In Person.GetProperty, return the value in a variant container.
+
Sat Nov 19 16:19:19 PST 2005 Christian Hammond <chipx86 at chipx86.com>
* src/core.c:
Modified: trunk/galago-daemon/src/person.c
===================================================================
--- trunk/galago-daemon/src/person.c 2005-11-20 09:21:21 UTC (rev 2330)
+++ trunk/galago-daemon/src/person.c 2005-11-20 09:21:47 UTC (rev 2331)
@@ -221,32 +221,56 @@
}
else
{
+ DBusMessageIter value_iter;
GalagoType type = galago_value_get_type(value);
reply = dbus_message_new_method_return(message);
dbus_message_iter_init_append(reply, &iter);
- if (type == GALAGO_VALUE_TYPE_STRING)
+ switch (type)
{
- const char *str = galago_value_get_string(value);
- dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &str);
+ case GALAGO_VALUE_TYPE_STRING:
+ {
+ const char *str = galago_value_get_string(value);
+ dbus_message_iter_open_container(&iter, DBUS_TYPE_VARIANT,
+ DBUS_TYPE_STRING_AS_STRING,
+ &value_iter);
+ dbus_message_iter_append_basic(&value_iter,
+ DBUS_TYPE_STRING, &str);
+ dbus_message_iter_close_container(&iter, &value_iter);
+ break;
+ }
+
+ case GALAGO_VALUE_TYPE_BOOLEAN:
+ {
+ gboolean b = galago_value_get_boolean(value);
+ dbus_message_iter_open_container(&iter, DBUS_TYPE_VARIANT,
+ DBUS_TYPE_BOOLEAN_AS_STRING,
+ &value_iter);
+ dbus_message_iter_append_basic(&value_iter,
+ DBUS_TYPE_BOOLEAN, &b);
+ dbus_message_iter_close_container(&iter, &value_iter);
+ break;
+ }
+
+ case GALAGO_VALUE_TYPE_UINT:
+ {
+ dbus_uint32_t i = galago_value_get_uint(value);
+ dbus_message_iter_open_container(&iter, DBUS_TYPE_VARIANT,
+ DBUS_TYPE_UINT32_AS_STRING,
+ &value_iter);
+ dbus_message_iter_append_basic(&value_iter,
+ DBUS_TYPE_UINT32, &i);
+ dbus_message_iter_close_container(&iter, &value_iter);
+ break;
+ }
+
+ default:
+ /* This should never happen. */
+ galago_log_fatal("Unknown property type %d for property %s\n",
+ type, name);
+ break;
}
- else if (type == GALAGO_VALUE_TYPE_BOOLEAN)
- {
- gboolean b = galago_value_get_boolean(value);
- dbus_message_iter_append_basic(&iter, DBUS_TYPE_BOOLEAN, &b);
- }
- else if (type == GALAGO_VALUE_TYPE_UINT)
- {
- dbus_uint32_t i = galago_value_get_uint(value);
- dbus_message_iter_append_basic(&iter, DBUS_TYPE_UINT32, &i);
- }
- else
- {
- /* This should never happen. */
- galago_log_fatal("Unknown property type %d for property %s\n",
- type, name);
- }
}
if (reply != NULL)
More information about the galago-commits
mailing list