[next] telepathy-glib: protocol: make protocol-properties-vardict writable
Guillaume Desmottes
gdesmott at kemper.freedesktop.org
Mon Mar 17 07:25:41 PDT 2014
Module: telepathy-glib
Branch: next
Commit: 174f8a1653f2480377cc3398c2dba233a43e020d
URL: http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=174f8a1653f2480377cc3398c2dba233a43e020d
Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date: Thu Mar 6 14:06:33 2014 +0100
protocol: make protocol-properties-vardict writable
---
telepathy-glib/protocol.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/telepathy-glib/protocol.c b/telepathy-glib/protocol.c
index 9a9f3d2..0d73031 100644
--- a/telepathy-glib/protocol.c
+++ b/telepathy-glib/protocol.c
@@ -324,11 +324,9 @@ tp_protocol_set_property (GObject *object,
self->priv->name = g_value_dup_string (value);
break;
- case PROP_PROTOCOL_PROPERTIES:
+ case PROP_PROTOCOL_PROPERTIES_VARDICT:
g_assert (self->priv->protocol_properties == NULL);
- self->priv->protocol_properties = tp_asv_to_vardict (
- g_value_get_boxed (value));
- g_variant_ref_sink (self->priv->protocol_properties);
+ self->priv->protocol_properties = g_value_dup_variant (value);
break;
case PROP_CM_NAME:
@@ -709,7 +707,7 @@ tp_protocol_class_init (TpProtocolClass *klass)
"Protocol properties",
"The immutable properties of this Protocol",
TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP,
- G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
/**
* TpProtocol:protocol-properties-vardict:
@@ -731,7 +729,7 @@ tp_protocol_class_init (TpProtocolClass *klass)
"Protocol properties",
"The immutable properties of this Protocol",
G_VARIANT_TYPE_VARDICT, NULL,
- G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* TpProtocol:english-name:
@@ -943,7 +941,6 @@ tp_protocol_new (TpDBusDaemon *dbus,
TpProtocol *ret = NULL;
gchar *bus_name = NULL;
gchar *object_path = NULL;
- GHashTable *hash = NULL;
g_return_val_if_fail (immutable_properties == NULL ||
g_variant_is_of_type (immutable_properties, G_VARIANT_TYPE_VARDICT),
@@ -967,19 +964,15 @@ tp_protocol_new (TpDBusDaemon *dbus,
/* e.g. local-xmpp -> local_xmpp */
g_strdelimit (object_path, "-", '_');
- hash = tp_asv_from_vardict (immutable_properties);
-
ret = TP_PROTOCOL (g_object_new (TP_TYPE_PROTOCOL,
"dbus-daemon", dbus,
"bus-name", bus_name,
"object-path", object_path,
"protocol-name", protocol_name,
- "protocol-properties", hash,
+ "protocol-properties-vardict", immutable_properties,
"cm-name", cm_name,
NULL));
- g_hash_table_unref (hash);
-
finally:
g_variant_unref (immutable_properties);
g_free (bus_name);
More information about the telepathy-commits
mailing list