From 248a1c9c0dc909e6ebd4bf93d3f83b873a697f06 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 17 Jul 2012 15:40:59 +0200 Subject: account-request: add missing 'service' getter --- telepathy-glib/account-request.c | 4 ++++ tests/dbus/account-request.c | 20 +++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/telepathy-glib/account-request.c b/telepathy-glib/account-request.c index 69060e384..3eea2f4a6 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 2a67cd8f7..96a2ad669 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 -- cgit v1.2.1