summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.co.uk>2012-06-07 16:45:16 +0200
committerXavier Claessens <xavier.claessens@collabora.co.uk>2012-06-29 15:02:58 +0200
commit5763dc9c9bce465c7cffbfa29a6403496363f70f (patch)
treeeb68eb3118dc6b6394ddf49ab1839cbc183b2b8b
parent9af5fe5b99a6446311660250a605abdcb5e4f353 (diff)
downloadtelepathy-glib-5763dc9c9bce465c7cffbfa29a6403496363f70f.tar.gz
TpConnection: deprecate connection-manager-name and add cm-name
This is to be consistent with TpProtocol naming.
-rw-r--r--docs/reference/telepathy-glib-sections.txt1
-rw-r--r--telepathy-glib/connection.c40
-rw-r--r--telepathy-glib/connection.h6
-rw-r--r--telepathy-glib/contact.c2
-rw-r--r--tests/dbus/connection.c6
5 files changed, 50 insertions, 5 deletions
diff --git a/docs/reference/telepathy-glib-sections.txt b/docs/reference/telepathy-glib-sections.txt
index be3ad0c98..e6e5b7d25 100644
--- a/docs/reference/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib-sections.txt
@@ -4205,6 +4205,7 @@ tp_connection_disconnect_finish
tp_connection_get_account
tp_connection_get_status
tp_connection_get_connection_manager_name
+tp_connection_get_cm_name
tp_connection_get_protocol_name
tp_connection_get_self_contact
tp_connection_get_self_handle
diff --git a/telepathy-glib/connection.c b/telepathy-glib/connection.c
index 011ae74c8..f818c993f 100644
--- a/telepathy-glib/connection.c
+++ b/telepathy-glib/connection.c
@@ -267,6 +267,7 @@ enum
PROP_STATUS = 1,
PROP_STATUS_REASON,
PROP_CONNECTION_MANAGER_NAME,
+ PROP_CM_NAME,
PROP_PROTOCOL_NAME,
PROP_CONNECTION_READY,
PROP_SELF_CONTACT,
@@ -319,6 +320,9 @@ tp_connection_get_property (GObject *object,
case PROP_CONNECTION_MANAGER_NAME:
g_value_set_string (value, self->priv->cm_name);
break;
+ case PROP_CM_NAME:
+ g_value_set_string (value, self->priv->cm_name);
+ break;
case PROP_PROTOCOL_NAME:
g_value_set_string (value, self->priv->proto_name);
break;
@@ -1762,7 +1766,7 @@ tp_connection_class_init (TpConnectionClass *klass)
* This connection's connection manager name.
*
* Since: 0.13.16
- *
+ * Deprecated: Use #TpConnection:cm-name instead.
*/
g_object_class_install_property (object_class, PROP_CONNECTION_MANAGER_NAME,
g_param_spec_string ("connection-manager-name",
@@ -1772,6 +1776,20 @@ tp_connection_class_init (TpConnectionClass *klass)
G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
/**
+ * TpConnection:cm-name:
+ *
+ * This connection's connection manager name.
+ *
+ * Since: 0.UNRELEASED
+ */
+ g_object_class_install_property (object_class, PROP_CM_NAME,
+ g_param_spec_string ("cm-name",
+ "Connection manager name",
+ "The connection's connection manager name",
+ NULL,
+ G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
+
+ /**
* TpConnection:protocol-name:
*
* The connection's machine-readable protocol name, such as "jabber",
@@ -2528,6 +2546,7 @@ tp_connection_get_status (TpConnection *self,
* Returns: the same as the #TpConnection:connection-manager-name property
*
* Since: 0.13.16
+ * Deprecated: Use tp_connection_get_cm_name() instead.
*
*/
const gchar *
@@ -2539,6 +2558,25 @@ tp_connection_get_connection_manager_name (TpConnection *self)
}
/**
+ * tp_connection_get_cm_name:
+ * @self: a #TpConnection
+ *
+ * <!-- -->
+ *
+ * Returns: the same as the #TpConnection:cm-name property
+ *
+ * Since: 0.UNRELEASED
+ *
+ */
+const gchar *
+tp_connection_get_cm_name (TpConnection *self)
+{
+ g_return_val_if_fail (TP_IS_CONNECTION (self), NULL);
+
+ return self->priv->cm_name;
+}
+
+/**
* tp_connection_get_protocol_name:
* @self: a #TpConnection
*
diff --git a/telepathy-glib/connection.h b/telepathy-glib/connection.h
index cfc605f10..ad501a7d9 100644
--- a/telepathy-glib/connection.h
+++ b/telepathy-glib/connection.h
@@ -149,7 +149,13 @@ TpAccount *tp_connection_get_account (TpConnection *self);
TpConnectionStatus tp_connection_get_status (TpConnection *self,
TpConnectionStatusReason *reason);
+#ifndef TP_DISABLE_DEPRECATED
+_TP_DEPRECATED_IN_UNRELEASED_FOR (tp_connection_get_cm_name)
const gchar *tp_connection_get_connection_manager_name (TpConnection *self);
+#endif
+
+_TP_AVAILABLE_IN_UNRELEASED
+const gchar *tp_connection_get_cm_name (TpConnection *self);
const gchar *tp_connection_get_protocol_name (TpConnection *self);
diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c
index b7d2b735a..abdc0a1c1 100644
--- a/telepathy-glib/contact.c
+++ b/telepathy-glib/contact.c
@@ -2639,7 +2639,7 @@ build_avatar_filename (TpConnection *connection,
token_escaped = tp_escape_as_identifier (avatar_token);
dir = g_build_filename (g_get_user_cache_dir (),
"telepathy", "avatars",
- tp_connection_get_connection_manager_name (connection),
+ tp_connection_get_cm_name (connection),
tp_connection_get_protocol_name (connection),
NULL);
diff --git a/tests/dbus/connection.c b/tests/dbus/connection.c
index f9f34d0da..0d2631133 100644
--- a/tests/dbus/connection.c
+++ b/tests/dbus/connection.c
@@ -224,13 +224,13 @@ test_prepare (Test *test,
g_assert_cmpint (tp_connection_get_status (test->conn, NULL), ==,
TP_CONNECTION_STATUS_DISCONNECTED);
- g_assert_cmpstr (tp_connection_get_connection_manager_name (test->conn), ==,
+ g_assert_cmpstr (tp_connection_get_cm_name (test->conn), ==,
"simple");
g_assert_cmpstr (tp_connection_get_protocol_name (test->conn), ==,
"simple-protocol");
g_object_get (test->conn,
- "connection-manager-name", &cm_name,
+ "cm-name", &cm_name,
"protocol-name", &protocol_name,
NULL);
g_assert_cmpstr (cm_name, ==, "simple");
@@ -409,7 +409,7 @@ test_object_path (Test *test,
g_assert_no_error (error);
tp_tests_proxy_run_until_prepared (test->conn, NULL);
- g_assert_cmpstr (tp_connection_get_connection_manager_name (test->conn), ==,
+ g_assert_cmpstr (tp_connection_get_cm_name (test->conn), ==,
"simple");
g_assert_cmpstr (tp_connection_get_protocol_name (test->conn), ==,
"simple-protocol");