telepathy-glib: account-request: add missing 'service' getter

Guillaume Desmottes gdesmott at kemper.freedesktop.org
Tue Jul 17 06:48:44 PDT 2012


Module: telepathy-glib
Branch: master
Commit: 248a1c9c0dc909e6ebd4bf93d3f83b873a697f06
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=248a1c9c0dc909e6ebd4bf93d3f83b873a697f06

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Tue Jul 17 15:40:59 2012 +0200

account-request: add missing 'service' getter

---

 telepathy-glib/account-request.c |    4 ++++
 tests/dbus/account-request.c     |   20 +++++++++++++++++++-
 2 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/telepathy-glib/account-request.c b/telepathy-glib/account-request.c
index 69060e3..3eea2f4 100644
--- a/telepathy-glib/account-request.c
+++ b/telepathy-glib/account-request.c
@@ -290,6 +290,10 @@ tp_account_request_get_property (GObject *object,
           g_value_set_string (value, g_value_get_string (array->values + 1));
       }
       break;
+    case PROP_SERVICE:
+      g_value_set_string (value, tp_asv_get_string (self->priv->properties,
+            TP_PROP_ACCOUNT_SERVICE));
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
diff --git a/tests/dbus/account-request.c b/tests/dbus/account-request.c
index 2a67cd8..96a2ad6 100644
--- a/tests/dbus/account-request.c
+++ b/tests/dbus/account-request.c
@@ -196,11 +196,11 @@ test_properties (Test *test,
   gchar **supersedes;
   GArray *avatar;
   gchar *mime_type;
-
   gboolean found;
   const gchar *s;
   gboolean b;
   GVariant *v;
+  gchar *service;
 
   test->account = tp_account_request_new (test->account_manager,
       "gabble", "jabber", "Walter Jr.");
@@ -355,6 +355,24 @@ test_properties (Test *test,
   g_variant_unref (props);
   g_array_unref (avatar);
   g_free (mime_type);
+
+  /* service */
+  tp_account_request_set_service (test->account, "Mushroom");
+
+  g_object_get (test->account,
+      "properties", &props,
+      "service", &service,
+      NULL);
+
+  v = g_variant_lookup_value (props, TP_PROP_ACCOUNT_SERVICE, NULL);
+  g_assert (v != NULL);
+  g_assert_cmpstr (g_variant_get_string (v, NULL), ==, "Mushroom");
+  g_variant_unref (v);
+
+  g_assert_cmpstr (service, ==, "Mushroom");
+
+  g_variant_unref (props);
+  g_free (service);
 }
 
 static void



More information about the telepathy-commits mailing list