[next] telepathy-mission-control: Adapt for removal of tp_connection_manager_param_get_default

Simon McVittie smcv at kemper.freedesktop.org
Tue Apr 8 12:12:01 PDT 2014


Module: telepathy-mission-control
Branch: next
Commit: 8a432b3e4f07eaa0599ef86b2cd81e3cf26be628
URL:    http://cgit.freedesktop.org/telepathy/telepathy-mission-control/commit/?id=8a432b3e4f07eaa0599ef86b2cd81e3cf26be628

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Fri Apr  4 16:33:40 2014 +0100

Adapt for removal of tp_connection_manager_param_get_default

This is far from the best possible implementation, but it unblocks us.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77139

---

 src/mcd-account.c |   21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/mcd-account.c b/src/mcd-account.c
index 8033e34..f4c51b4 100644
--- a/src/mcd-account.c
+++ b/src/mcd-account.c
@@ -2399,6 +2399,23 @@ set_parameter_changed (GHashTable *dbus_properties,
     }
 }
 
+/* A reimplementation of the old tp_connection_manager_param_get_default(),
+ * because one day we should switch McdAccount to use GVariant throughout,
+ * but this is not that day */
+static gboolean
+param_get_default (const TpConnectionManagerParam *param,
+    GValue *value)
+{
+  GVariant *variant = tp_connection_manager_param_dup_default_variant (param);
+
+  if (variant == NULL)
+    return FALSE;
+
+  dbus_g_value_parse_g_variant (variant, value);
+  g_variant_unref (variant);
+  return TRUE;
+}
+
 static gboolean
 check_one_parameter_update (McdAccount *account,
                             TpProtocol *protocol,
@@ -2446,7 +2463,7 @@ check_one_parameter_update (McdAccount *account,
          */
         if (mcd_account_get_parameter (account, param,
                 &current_value, NULL) ||
-            tp_connection_manager_param_get_default (param, &current_value))
+            param_get_default (param, &current_value))
         {
             if (!value_is_same (&current_value, new_value))
                 set_parameter_changed (dbus_properties, not_yet, param,
@@ -2495,7 +2512,7 @@ check_one_parameter_unset (McdAccount *account,
              */
             GValue default_value = G_VALUE_INIT;
 
-            if (tp_connection_manager_param_get_default (param, &default_value))
+            if (param_get_default (param, &default_value))
             {
                 if (!value_is_same (&current_value, &default_value))
                     set_parameter_changed (dbus_properties, not_yet, param,



More information about the telepathy-commits mailing list