From 505305a0bc8f02ca770014682f0794b8c9353aef Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 5 Jun 2012 15:00:44 +0200 Subject: account-settings: use TpProtocol's API to get TpConnectionManagerParam https://bugzilla.gnome.org/show_bug.cgi?id=677465 --- libempathy/empathy-account-settings.c | 39 ++++++++--------------------------- libempathy/empathy-account-settings.h | 2 +- 2 files changed, 10 insertions(+), 31 deletions(-) (limited to 'libempathy') diff --git a/libempathy/empathy-account-settings.c b/libempathy/empathy-account-settings.c index f88ff3dd7..7e3129766 100644 --- a/libempathy/empathy-account-settings.c +++ b/libempathy/empathy-account-settings.c @@ -689,25 +689,14 @@ empathy_account_settings_new_for_account (TpAccount *account) NULL); } -TpConnectionManagerParam * -empathy_account_settings_get_tp_params (EmpathyAccountSettings *settings) +GList * +empathy_account_settings_dup_tp_params (EmpathyAccountSettings *settings) { EmpathyAccountSettingsPriv *priv = GET_PRIV (settings); - const TpConnectionManagerProtocol *tp_protocol; - g_return_val_if_fail (priv->manager != NULL, NULL); - g_return_val_if_fail (priv->protocol != NULL, NULL); + g_return_val_if_fail (priv->protocol_obj != NULL, NULL); - tp_protocol = tp_connection_manager_get_protocol (priv->manager, - priv->protocol); - if (tp_protocol == NULL) - { - DEBUG ("Can't retrieve TpConnectionManagerProtocol for protocol '%s'", - priv->protocol); - return NULL; - } - - return tp_protocol->params; + return tp_protocol_dup_params (priv->protocol_obj); } gboolean @@ -800,23 +789,13 @@ empathy_account_settings_is_unset (EmpathyAccountSettings *settings, return FALSE; } -static TpConnectionManagerParam * +static const TpConnectionManagerParam * empathy_account_settings_get_tp_param (EmpathyAccountSettings *settings, const gchar *param) { - TpConnectionManagerParam *tp_params = - empathy_account_settings_get_tp_params (settings); - TpConnectionManagerParam *p; - - for (p = tp_params; p != NULL && p->name != NULL; p++) - { - if (tp_strdiff (p->name, param)) - continue; - - return p; - } + EmpathyAccountSettingsPriv *priv = GET_PRIV (settings); - return NULL; + return tp_protocol_get_param (priv->protocol_obj, param); } gboolean @@ -853,7 +832,7 @@ const GValue * empathy_account_settings_get_default (EmpathyAccountSettings *settings, const gchar *param) { - TpConnectionManagerParam *p; + const TpConnectionManagerParam *p; p = empathy_account_settings_get_tp_param (settings, param); @@ -867,7 +846,7 @@ const gchar * empathy_account_settings_get_dbus_signature (EmpathyAccountSettings *settings, const gchar *param) { - TpConnectionManagerParam *p; + const TpConnectionManagerParam *p; p = empathy_account_settings_get_tp_param (settings, param); diff --git a/libempathy/empathy-account-settings.h b/libempathy/empathy-account-settings.h index 25816131c..baa0ad76e 100644 --- a/libempathy/empathy-account-settings.h +++ b/libempathy/empathy-account-settings.h @@ -87,7 +87,7 @@ TpAccount *empathy_account_settings_get_account ( gboolean empathy_account_settings_has_account ( EmpathyAccountSettings *settings, TpAccount *account); -TpConnectionManagerParam *empathy_account_settings_get_tp_params ( +GList * empathy_account_settings_dup_tp_params ( EmpathyAccountSettings *settings); gboolean empathy_account_settings_have_tp_param ( -- cgit v1.2.3