telepathy-glib/tg-add-TpAccount-uri-schemes-property.patch
2013-01-17 19:15:54 +00:00

144 lines
4.6 KiB
Diff

From 15b8eea5133e683ac14c79734dfbea6747af6e5f Mon Sep 17 00:00:00 2001
From: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Date: Mon, 07 Jan 2013 16:07:50 +0000
Subject: add TpAccount:uri-schemes: property
The property was missing for some reason.
---
diff --git a/telepathy-glib/account.c b/telepathy-glib/account.c
index 026ad46..c49699c 100644
--- a/telepathy-glib/account.c
+++ b/telepathy-glib/account.c
@@ -181,6 +181,7 @@ enum {
PROP_STORAGE_IDENTIFIER_VARIANT,
PROP_STORAGE_RESTRICTIONS,
PROP_SUPERSEDES,
+ PROP_URI_SCHEMES,
N_PROPS
};
@@ -1149,6 +1150,9 @@ _tp_account_get_property (GObject *object,
case PROP_SUPERSEDES:
g_value_set_boxed (value, self->priv->supersedes);
break;
+ case PROP_URI_SCHEMES:
+ g_value_set_boxed (value, self->priv->uri_schemes);
+ break;
case PROP_AUTOMATIC_PRESENCE_TYPE:
g_value_set_uint (value, self->priv->auto_presence);
break;
@@ -2030,6 +2034,29 @@ tp_account_class_init (TpAccountClass *klass)
G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
/**
+ * TpAccount:uri-schemes:
+ *
+ * If the %TP_ACCOUNT_FEATURE_ADDRESSING feature has been prepared
+ * successfully, a list of additional URI schemes for which this
+ * account should be used if possible. Otherwise %NULL.
+ *
+ * For instance, a SIP or Skype account might have "tel" in this list if the
+ * user would like to use that account to call phone numbers.
+ *
+ * This list should not contain the primary URI scheme(s) for the account's
+ * protocol (for instance, "xmpp" for XMPP, or "sip" or "sips" for SIP),
+ * since it should be assumed to be useful for those schemes in any case.
+ *
+ * Since: UNRELEASED
+ */
+ g_object_class_install_property (object_class, PROP_URI_SCHEMES,
+ g_param_spec_boxed ("uri-schemes",
+ "URISchemes",
+ "URISchemes",
+ G_TYPE_STRV,
+ G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
+
+ /**
* TpAccount::status-changed:
* @account: the #TpAccount
* @old_status: old #TpAccount:connection-status
@@ -4225,18 +4252,9 @@ tp_account_prepare_addressing_async (TpProxy *proxy,
* tp_account_get_uri_schemes:
* @self: a #TpAccount
*
- * If the %TP_ACCOUNT_FEATURE_ADDRESSING feature has been prepared
- * successfully, return a list of additional URI schemes for which this
- * account should be used if possible. Otherwise return %NULL.
- *
- * For instance, a SIP or Skype account might have "tel" in this list if the
- * user would like to use that account to call phone numbers.
- *
- * This list should not contain the primary URI scheme(s) for the account's
- * protocol (for instance, "xmpp" for XMPP, or "sip" or "sips" for SIP),
- * since it should be assumed to be useful for those schemes in any case.
+ * Return the #TpAccount:uri-schemes property
*
- * Returns: (transfer none): a list of URI schemes, or %NULL
+ * Returns: (transfer none): the value of #TpAccount:uri_schemes property
*
* Since: 0.13.8
*/
diff --git a/tests/dbus/account.c b/tests/dbus/account.c
index 3fb54b4..dc27ac1 100644
--- a/tests/dbus/account.c
+++ b/tests/dbus/account.c
@@ -614,11 +614,29 @@ test_storage (Test *test,
}
static void
+check_uri_schemes (const gchar * const * schemes)
+{
+ g_assert (schemes != NULL);
+ g_assert (tp_strv_contains (schemes, "about"));
+ g_assert (tp_strv_contains (schemes, "telnet"));
+ g_assert (schemes[2] == NULL);
+}
+
+static void
+notify_cb (GObject *object,
+ GParamSpec *spec,
+ Test *test)
+{
+ g_main_loop_quit (test->mainloop);
+}
+
+static void
test_addressing (Test *test,
gconstpointer mode)
{
GQuark account_features[] = { TP_ACCOUNT_FEATURE_ADDRESSING, 0 };
const gchar * const *schemes;
+ GStrv tmp;
test->account = tp_account_new (test->dbus, ACCOUNT_PATH, NULL);
g_assert (test->account != NULL);
@@ -645,10 +663,14 @@ test_addressing (Test *test,
g_main_loop_run (test->mainloop);
schemes = tp_account_get_uri_schemes (test->account);
- g_assert (schemes != NULL);
- g_assert (tp_strv_contains (schemes, "about"));
- g_assert (tp_strv_contains (schemes, "telnet"));
- g_assert (schemes[2] == NULL);
+ check_uri_schemes (schemes);
+
+ g_object_get (test->account,
+ "uri-schemes", &tmp,
+ NULL);
+
+ check_uri_schemes ((const gchar * const *) tmp);
+ g_strfreev (tmp);
g_assert (tp_account_associated_with_uri_scheme (test->account,
"about"));
@@ -656,7 +678,6 @@ test_addressing (Test *test,
"telnet"));
g_assert (!tp_account_associated_with_uri_scheme (test->account,
"xmpp"));
-
}
static void
--
cgit v0.9.0.2-2-gbebe