From 9f3b78eabe35a1e0d3861d96ef048eaf86c45505 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Wed, 16 May 2012 13:10:31 +0200 Subject: [PATCH] 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(+) diff --git a/telepathy-glib/account.c b/telepathy-glib/account.c index 88f13d2..7855887 100644 --- a/telepathy-glib/account.c +++ b/telepathy-glib/account.c @@ -2077,6 +2077,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 d1f5684..35b69eb 100644 --- a/telepathy-glib/account.h +++ b/telepathy-glib/account.h @@ -82,6 +82,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 87ea773..6c85ac1 100644 --- a/telepathy-glib/channel.h +++ b/telepathy-glib/channel.h @@ -73,11 +73,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 a3988ee..d9f508b 100644 --- a/telepathy-glib/connection.c +++ b/telepathy-glib/connection.c @@ -2345,6 +2345,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 55a0061..d21ddeb 100644 --- a/telepathy-glib/connection.h +++ b/telepathy-glib/connection.h @@ -136,6 +136,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 83c4550..91a43eb 100644 --- a/telepathy-glib/file-transfer-channel.h +++ b/telepathy-glib/file-transfer-channel.h @@ -64,6 +64,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 39c2c7e..73cb8db 100644 --- a/telepathy-glib/stream-tube-channel.h +++ b/telepathy-glib/stream-tube-channel.h @@ -55,6 +55,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 828def4..001baf0 100644 --- a/telepathy-glib/text-channel.h +++ b/telepathy-glib/text-channel.h @@ -56,6 +56,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, -- 1.7.9.5