[next] telepathy-glib: base-connection: use _tp_asv_from_vardict()

Xavier Claessens xclaesse at kemper.freedesktop.org
Wed May 9 13:10:50 PDT 2012


Module: telepathy-glib
Branch: next
Commit: 9f4260f19ef4344c75eeaefb799603a9dfc360fc
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=9f4260f19ef4344c75eeaefb799603a9dfc360fc

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Thu Apr 19 11:50:26 2012 +0200

base-connection: use _tp_asv_from_vardict()

---

 telepathy-glib/base-connection.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c
index 6b2f869..7ba4be8 100644
--- a/telepathy-glib/base-connection.c
+++ b/telepathy-glib/base-connection.c
@@ -242,6 +242,7 @@
 #include <telepathy-glib/contacts-mixin.h>
 #include <telepathy-glib/dbus-properties-mixin.h>
 #include <telepathy-glib/dbus.h>
+#include <telepathy-glib/dbus-internal.h>
 #include <telepathy-glib/exportable-channel.h>
 #include <telepathy-glib/gtypes.h>
 #include <telepathy-glib/interfaces.h>
@@ -2801,29 +2802,25 @@ tp_base_connection_disconnect_with_dbus_error_vardict (TpBaseConnection *self,
     GVariant *details,
     TpConnectionStatusReason reason)
 {
-  GValue value = G_VALUE_INIT;
+  GHashTable *hash;
 
   g_return_if_fail (TP_IS_BASE_CONNECTION (self));
   g_return_if_fail (tp_dbus_check_valid_interface_name (error_name, NULL));
-  g_return_if_fail (g_variant_is_of_type (details, G_VARIANT_TYPE_VARDICT));
 
   if (details == NULL)
     {
-      g_value_init (&value, TP_HASH_TYPE_STRING_VARIANT_MAP);
-      g_value_take_boxed (&value, g_hash_table_new (g_str_hash, g_str_equal));
+      hash = g_hash_table_new (g_str_hash, g_str_equal);
     }
   else
     {
-      dbus_g_value_parse_g_variant (details, &value);
-      g_assert (G_VALUE_TYPE (&value) == TP_HASH_TYPE_STRING_VARIANT_MAP);
+      hash = _tp_asv_from_vardict (details);
     }
 
-  tp_svc_connection_emit_connection_error (self, error_name,
-      g_value_get_boxed (&value));
+  tp_svc_connection_emit_connection_error (self, error_name, hash);
   tp_base_connection_change_status (self, TP_CONNECTION_STATUS_DISCONNECTED,
       reason);
 
-  g_value_unset (&value);
+  g_hash_table_unref (hash);
 }
 
 /**



More information about the telepathy-commits mailing list