diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2009-06-10 11:43:06 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2009-06-11 11:19:52 +0100 |
commit | 7bcc81a573226d7ec435fa9f1bd4fe0437edbfa9 (patch) | |
tree | 9fcef8cace3688c582b89b6364784997499a18d3 /src/mcd-account.c | |
parent | 5abdade8ddeb299b5065a936b4aab2b614244338 (diff) |
McdAccount: fd.o #21377: add support for deserializing doubles and object paths
Diffstat (limited to 'src/mcd-account.c')
-rw-r--r-- | src/mcd-account.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mcd-account.c b/src/mcd-account.c index b04a2692..05e1d9df 100644 --- a/src/mcd-account.c +++ b/src/mcd-account.c @@ -371,6 +371,7 @@ get_parameter (McdAccount *account, const gchar *name, GValue *value) gint64 v_int = 0; guint64 v_uint = 0; gboolean v_bool = FALSE; + double v_double = 0.0; switch (G_VALUE_TYPE (value)) { @@ -427,6 +428,13 @@ get_parameter (McdAccount *account, const gchar *name, GValue *value) key, NULL); g_value_set_boolean (value, v_bool); break; + + case G_TYPE_DOUBLE: + v_double = g_key_file_get_double (priv->keyfile, priv->unique_name, + key, NULL); + g_value_set_double (value, v_double); + break; + default: if (G_VALUE_HOLDS (value, G_TYPE_STRV)) { @@ -436,6 +444,20 @@ get_parameter (McdAccount *account, const gchar *name, GValue *value) g_value_take_boxed (value, v); } + else if (G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH)) + { + v_string = g_key_file_get_string (priv->keyfile, + priv->unique_name, key, + NULL); + + if (!tp_dbus_check_valid_object_path (v_string, NULL)) + { + g_free (v_string); + return FALSE; + } + + g_value_take_boxed (value, v_string); + } else { g_warning ("%s: skipping parameter %s, unknown type %s", |