summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-07-17 15:40:59 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-07-17 15:40:59 +0200
commit248a1c9c0dc909e6ebd4bf93d3f83b873a697f06 (patch)
tree0026f1fdae373045fb98d8b7bb3541e9fc16ee13
parentb0e97c3827c4f5da668e0472afa0f02f7b533a47 (diff)
downloadtelepathy-glib-248a1c9c0dc909e6ebd4bf93d3f83b873a697f06.tar.gz
account-request: add missing 'service' getter
-rw-r--r--telepathy-glib/account-request.c4
-rw-r--r--tests/dbus/account-request.c20
2 files changed, 23 insertions, 1 deletions
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