telepathy-glib: Deprecate tp_account_new(), tp_connection_new() and tp_*_channel_new()

Xavier Claessens xclaesse at kemper.freedesktop.org
Tue Jul 3 04:55:40 PDT 2012


Module: telepathy-glib
Branch: master
Commit: 50fdb9d38694d620dbe49ff00572df1e54454052
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=50fdb9d38694d620dbe49ff00572df1e54454052

Author: Xavier Claessens <xavier.claessens at collabora.co.uk>
Date:   Wed May 16 13:10:31 2012 +0200

Deprecate tp_account_new(), tp_connection_new() and tp_*_channel_new()

Those proxies should be constructed using TpSimpleClientFactory

https://bugs.freedesktop.org/show_bug.cgi?id=49372

---

 telepathy-glib/account.c                 |    1 +
 telepathy-glib/account.h                 |    1 +
 telepathy-glib/automatic-proxy-factory.c |    5 +++++
 telepathy-glib/channel.c                 |    2 ++
 telepathy-glib/channel.h                 |    2 ++
 telepathy-glib/client-channel-factory.c  |    5 +++++
 telepathy-glib/connection.c              |    1 +
 telepathy-glib/connection.h              |    1 +
 telepathy-glib/file-transfer-channel.c   |    1 +
 telepathy-glib/file-transfer-channel.h   |    1 +
 telepathy-glib/stream-tube-channel.c     |    1 +
 telepathy-glib/stream-tube-channel.h     |    1 +
 telepathy-glib/text-channel.c            |    1 +
 telepathy-glib/text-channel.h            |    1 +
 14 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/telepathy-glib/account.c b/telepathy-glib/account.c
index c58f434..6a313a6 100644
--- a/telepathy-glib/account.c
+++ b/telepathy-glib/account.c
@@ -2117,6 +2117,7 @@ tp_account_init_known_interfaces (void)
  *
  * Returns: a new reference to an account proxy, or %NULL if @object_path is
  *    not valid
+ * Deprecated: Use tp_simple_client_factory_ensure_account() instead.
  */
 TpAccount *
 tp_account_new (TpDBusDaemon *bus_daemon,
diff --git a/telepathy-glib/account.h b/telepathy-glib/account.h
index 88e32bc..8518263 100644
--- a/telepathy-glib/account.h
+++ b/telepathy-glib/account.h
@@ -86,6 +86,7 @@ GQuark tp_account_get_feature_quark_connection (void) G_GNUC_CONST;
 GQuark tp_account_get_feature_quark_storage (void) G_GNUC_CONST;
 GQuark tp_account_get_feature_quark_addressing (void) G_GNUC_CONST;
 
+_TP_DEPRECATED_IN_UNRELEASED_FOR(tp_simple_client_factory_ensure_account)
 TpAccount *tp_account_new (TpDBusDaemon *bus_daemon, const gchar *object_path,
     GError **error) G_GNUC_WARN_UNUSED_RESULT;
 
diff --git a/telepathy-glib/automatic-proxy-factory.c b/telepathy-glib/automatic-proxy-factory.c
index 9af0939..3e526ba 100644
--- a/telepathy-glib/automatic-proxy-factory.c
+++ b/telepathy-glib/automatic-proxy-factory.c
@@ -115,6 +115,9 @@ G_DEFINE_TYPE_WITH_CODE(TpAutomaticProxyFactory,
     G_IMPLEMENT_INTERFACE (TP_TYPE_CLIENT_CHANNEL_FACTORY,
       client_proxy_factory_iface_init))
 
+/* Deprecated module can use deprecated APIs */
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
 static void
 tp_automatic_proxy_factory_init (TpAutomaticProxyFactory *self)
 {
@@ -299,3 +302,5 @@ tp_automatic_proxy_factory_dup (void)
 
   return singleton;
 }
+
+G_GNUC_END_IGNORE_DEPRECATIONS
diff --git a/telepathy-glib/channel.c b/telepathy-glib/channel.c
index 6d9d6d8..f70b9d5 100644
--- a/telepathy-glib/channel.c
+++ b/telepathy-glib/channel.c
@@ -2000,6 +2000,7 @@ tp_channel_class_init (TpChannelClass *klass)
  * Returns: a new channel proxy, or %NULL on invalid arguments
  *
  * Since: 0.7.19
+ * Deprecated: Use tp_simple_client_factory_ensure_channel() instead.
  */
 TpChannel *
 tp_channel_new_from_properties (TpConnection *conn,
@@ -2064,6 +2065,7 @@ finally:
  * Returns: a new channel proxy, or %NULL on invalid arguments.
  *
  * Since: 0.7.1
+ * Deprecated: Use tp_simple_client_factory_ensure_channel() instead.
  */
 TpChannel *
 tp_channel_new (TpConnection *conn,
diff --git a/telepathy-glib/channel.h b/telepathy-glib/channel.h
index 837fae8..d72ad74 100644
--- a/telepathy-glib/channel.h
+++ b/telepathy-glib/channel.h
@@ -77,11 +77,13 @@ GQuark tp_errors_removed_from_group_quark (void);
   (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CHANNEL, \
                               TpChannelClass))
 
+_TP_DEPRECATED_IN_UNRELEASED_FOR(tp_simple_client_factory_ensure_channel)
 TpChannel *tp_channel_new (TpConnection *conn,
     const gchar *object_path, const gchar *optional_channel_type,
     TpHandleType optional_handle_type, TpHandle optional_handle,
     GError **error) G_GNUC_WARN_UNUSED_RESULT;
 
+_TP_DEPRECATED_IN_UNRELEASED_FOR(tp_simple_client_factory_ensure_channel)
 TpChannel *tp_channel_new_from_properties (TpConnection *conn,
     const gchar *object_path, const GHashTable *immutable_properties,
     GError **error) G_GNUC_WARN_UNUSED_RESULT;
diff --git a/telepathy-glib/client-channel-factory.c b/telepathy-glib/client-channel-factory.c
index addfc6f..c5d3cf4 100644
--- a/telepathy-glib/client-channel-factory.c
+++ b/telepathy-glib/client-channel-factory.c
@@ -75,6 +75,9 @@
 G_DEFINE_INTERFACE(TpClientChannelFactory, tp_client_channel_factory,
     G_TYPE_OBJECT)
 
+/* Deprecated module can use deprecated APIs */
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
 static void
 tp_client_channel_factory_default_init (TpClientChannelFactoryInterface *iface)
 {
@@ -165,3 +168,5 @@ tp_client_channel_factory_dup_channel_features (
 
   return arr;
 }
+
+G_GNUC_END_IGNORE_DEPRECATIONS
diff --git a/telepathy-glib/connection.c b/telepathy-glib/connection.c
index f818c99..f929365 100644
--- a/telepathy-glib/connection.c
+++ b/telepathy-glib/connection.c
@@ -2364,6 +2364,7 @@ tp_connection_class_init (TpConnectionClass *klass)
  *  fails or on invalid arguments
  *
  * Since: 0.7.1
+ * Deprecated: Use tp_simple_client_factory_ensure_connection() instead.
  */
 TpConnection *
 tp_connection_new (TpDBusDaemon *dbus,
diff --git a/telepathy-glib/connection.h b/telepathy-glib/connection.h
index ad501a7..d4a0508 100644
--- a/telepathy-glib/connection.h
+++ b/telepathy-glib/connection.h
@@ -140,6 +140,7 @@ GQuark tp_errors_disconnected_quark (void);
   (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CONNECTION, \
                               TpConnectionClass))
 
+_TP_DEPRECATED_IN_UNRELEASED_FOR(tp_simple_client_factory_ensure_connection)
 TpConnection *tp_connection_new (TpDBusDaemon *dbus, const gchar *bus_name,
     const gchar *object_path, GError **error) G_GNUC_WARN_UNUSED_RESULT;
 
diff --git a/telepathy-glib/file-transfer-channel.c b/telepathy-glib/file-transfer-channel.c
index db39bff..fcf0c6b 100644
--- a/telepathy-glib/file-transfer-channel.c
+++ b/telepathy-glib/file-transfer-channel.c
@@ -1058,6 +1058,7 @@ tp_file_transfer_channel_get_feature_quark_core (void)
  * Returns: (transfer full): a newly created #TpFileTransferChannel
  *
  * Since: 0.15.5
+ * Deprecated: Use tp_simple_client_factory_ensure_channel() instead.
  */
 TpFileTransferChannel *
 tp_file_transfer_channel_new (TpConnection *conn,
diff --git a/telepathy-glib/file-transfer-channel.h b/telepathy-glib/file-transfer-channel.h
index cbd645e..eed4fe6 100644
--- a/telepathy-glib/file-transfer-channel.h
+++ b/telepathy-glib/file-transfer-channel.h
@@ -68,6 +68,7 @@ GType tp_file_transfer_channel_get_type (void);
 /* Methods */
 
 _TP_AVAILABLE_IN_0_16
+_TP_DEPRECATED_IN_UNRELEASED_FOR(tp_simple_client_factory_ensure_channel)
 TpFileTransferChannel * tp_file_transfer_channel_new (TpConnection *conn,
     const gchar *object_path,
     const GHashTable *immutable_properties,
diff --git a/telepathy-glib/stream-tube-channel.c b/telepathy-glib/stream-tube-channel.c
index d3bf545..452e02c 100644
--- a/telepathy-glib/stream-tube-channel.c
+++ b/telepathy-glib/stream-tube-channel.c
@@ -488,6 +488,7 @@ tp_stream_tube_channel_init (TpStreamTubeChannel *self)
  * Returns: (transfer full): a newly-created #TpStreamTubeChannel proxy
  *
  * Since: 0.13.2
+ * Deprecated: Use tp_simple_client_factory_ensure_channel() instead.
  */
 TpStreamTubeChannel *
 tp_stream_tube_channel_new (TpConnection *conn,
diff --git a/telepathy-glib/stream-tube-channel.h b/telepathy-glib/stream-tube-channel.h
index 26709a5..62b23f6 100644
--- a/telepathy-glib/stream-tube-channel.h
+++ b/telepathy-glib/stream-tube-channel.h
@@ -59,6 +59,7 @@ struct _TpStreamTubeChannelClass
 
 GType tp_stream_tube_channel_get_type (void);
 
+_TP_DEPRECATED_IN_UNRELEASED_FOR(tp_simple_client_factory_ensure_channel)
 TpStreamTubeChannel *tp_stream_tube_channel_new (TpConnection *conn,
     const gchar *object_path,
     const GHashTable *immutable_properties,
diff --git a/telepathy-glib/text-channel.c b/telepathy-glib/text-channel.c
index 24c49af..0f8ca6c 100644
--- a/telepathy-glib/text-channel.c
+++ b/telepathy-glib/text-channel.c
@@ -1126,6 +1126,7 @@ tp_text_channel_init (TpTextChannel *self)
  * Returns: (transfer full): a newly created #TpTextChannel
  *
  * Since: 0.13.10
+ * Deprecated: Use tp_simple_client_factory_ensure_channel() instead.
  */
 TpTextChannel *
 tp_text_channel_new (TpConnection *conn,
diff --git a/telepathy-glib/text-channel.h b/telepathy-glib/text-channel.h
index c4f7829..2b07a7d 100644
--- a/telepathy-glib/text-channel.h
+++ b/telepathy-glib/text-channel.h
@@ -60,6 +60,7 @@ struct _TpTextChannelClass
 
 GType tp_text_channel_get_type (void);
 
+_TP_DEPRECATED_IN_UNRELEASED_FOR(tp_simple_client_factory_ensure_channel)
 TpTextChannel *tp_text_channel_new (TpConnection *conn,
     const gchar *object_path,
     const GHashTable *immutable_properties,



More information about the telepathy-commits mailing list