diff options
author | Xavier Claessens <xavier.claessens@collabora.co.uk> | 2012-06-07 17:10:39 +0200 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.co.uk> | 2012-06-29 15:02:59 +0200 |
commit | db27aa71a3aad393d971eefebac3b6bc03d49f3c (patch) | |
tree | 412cdd077a996b0f7db9e81f20d796e203161718 | |
parent | d0335d2645f365834e313c086d0fe30ce7798d09 (diff) | |
download | telepathy-glib-db27aa71a3aad393d971eefebac3b6bc03d49f3c.tar.gz |
TpConnectionManager: deprecate "connection-manager" and add "cm-name"
Otherwise we could assume they are returning TpConnectionManager objects.
This is more consistent with TpProtocol, TpConnection and TpAccountRequest API.
-rw-r--r-- | telepathy-glib/connection-manager.c | 23 | ||||
-rw-r--r-- | tests/dbus/cm.c | 10 |
2 files changed, 27 insertions, 6 deletions
diff --git a/telepathy-glib/connection-manager.c b/telepathy-glib/connection-manager.c index 25583a799..4760daa22 100644 --- a/telepathy-glib/connection-manager.c +++ b/telepathy-glib/connection-manager.c @@ -154,6 +154,7 @@ enum PROP_MANAGER_FILE, PROP_ALWAYS_INTROSPECT, PROP_CONNECTION_MANAGER, + PROP_CM_NAME, N_PROPS }; @@ -1270,6 +1271,10 @@ tp_connection_manager_get_property (GObject *object, g_value_set_string (value, self->name); break; + case PROP_CM_NAME: + g_value_set_string (value, self->name); + break; + case PROP_INFO_SOURCE: g_value_set_uint (value, self->info_source); break; @@ -1451,6 +1456,8 @@ tp_connection_manager_class_init (TpConnectionManagerClass *klass) * TpConnectionManager:connection-manager: * * The name of the connection manager, e.g. "gabble" (read-only). + * + * Deprecated: Use #TpConnectionManager:cm-name instead. */ param_spec = g_param_spec_string ("connection-manager", "CM name", "The name of the connection manager, e.g. \"gabble\" (read-only)", @@ -1460,6 +1467,20 @@ tp_connection_manager_class_init (TpConnectionManagerClass *klass) param_spec); /** + * TpConnectionManager:cm-name: + * + * The name of the connection manager, e.g. "gabble" (read-only). + * + * Since: 0.UNRELEASED + */ + param_spec = g_param_spec_string ("cm-name", "CM name", + "The name of the connection manager, e.g. \"gabble\" (read-only)", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); + g_object_class_install_property (object_class, PROP_CM_NAME, + param_spec); + + /** * TpConnectionManager:manager-file: * * The absolute path of the .manager file. If set to %NULL (the default), @@ -2062,7 +2083,7 @@ tp_connection_manager_check_valid_protocol_name (const gchar *name, * The returned string is valid as long as @self is. Copy it with g_strdup() * if a longer lifetime is required. * - * Returns: the #TpConnectionManager:connection-manager property + * Returns: the #TpConnectionManager:cm-name property * Since: 0.7.26 */ const gchar * diff --git a/tests/dbus/cm.c b/tests/dbus/cm.c index ade565cd3..363c1e79a 100644 --- a/tests/dbus/cm.c +++ b/tests/dbus/cm.c @@ -789,7 +789,7 @@ test_nothing_ready (Test *test, g_object_get (test->cm, "info-source", &info_source, - "connection-manager", &name, + "cm-name", &name, NULL); g_assert_cmpstr (name, ==, "nonexistent_cm"); g_assert_cmpuint (info_source, ==, TP_CM_INFO_SOURCE_NONE); @@ -837,7 +837,7 @@ test_file_ready (Test *test, g_object_get (test->cm, "info-source", &info_source, - "connection-manager", &name, + "cm-name", &name, NULL); g_assert_cmpstr (name, ==, "spurious"); g_assert_cmpuint (info_source, ==, TP_CM_INFO_SOURCE_FILE); @@ -890,7 +890,7 @@ test_complex_file_ready (Test *test, g_object_get (test->cm, "info-source", &info_source, - "connection-manager", &name, + "cm-name", &name, NULL); g_assert_cmpstr (name, ==, "test_manager_file"); g_assert_cmpuint (info_source, ==, TP_CM_INFO_SOURCE_FILE); @@ -961,7 +961,7 @@ test_dbus_ready (Test *test, g_object_get (test->cm, "info-source", &info_source, - "connection-manager", &name, + "cm-name", &name, NULL); g_assert_cmpstr (name, ==, "example_echo"); g_assert_cmpuint (info_source, ==, TP_CM_INFO_SOURCE_LIVE); @@ -1044,7 +1044,7 @@ test_dbus_fallback (Test *test, g_object_get (test->cm, "info-source", &info_source, - "connection-manager", &name, + "cm-name", &name, NULL); g_assert_cmpstr (name, ==, "example_echo"); g_assert_cmpuint (info_source, ==, TP_CM_INFO_SOURCE_LIVE); |