telepathy-glib: TpConnectionManager: deprecate "connection-manager" and add "cm-name"
Xavier Claessens
xclaesse at kemper.freedesktop.org
Fri Jun 29 06:10:34 PDT 2012
Module: telepathy-glib
Branch: master
Commit: db27aa71a3aad393d971eefebac3b6bc03d49f3c
URL: http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=db27aa71a3aad393d971eefebac3b6bc03d49f3c
Author: Xavier Claessens <xavier.claessens at collabora.co.uk>
Date: Thu Jun 7 17:10:39 2012 +0200
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.
---
telepathy-glib/connection-manager.c | 23 ++++++++++++++++++++++-
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 25583a7..4760daa 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 ade565c..363c1e7 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);
More information about the telepathy-commits
mailing list