aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-06-05 21:00:44 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-06-06 17:28:44 +0800
commit505305a0bc8f02ca770014682f0794b8c9353aef (patch)
tree84012aec08661542aacbe6ad0ebe7430a8b61b70
parentc92e84c8b183d3fd5b18427d58a827b4bb865435 (diff)
downloadgsoc2013-empathy-505305a0bc8f02ca770014682f0794b8c9353aef.tar
gsoc2013-empathy-505305a0bc8f02ca770014682f0794b8c9353aef.tar.gz
gsoc2013-empathy-505305a0bc8f02ca770014682f0794b8c9353aef.tar.bz2
gsoc2013-empathy-505305a0bc8f02ca770014682f0794b8c9353aef.tar.lz
gsoc2013-empathy-505305a0bc8f02ca770014682f0794b8c9353aef.tar.xz
gsoc2013-empathy-505305a0bc8f02ca770014682f0794b8c9353aef.tar.zst
gsoc2013-empathy-505305a0bc8f02ca770014682f0794b8c9353aef.zip
account-settings: use TpProtocol's API to get TpConnectionManagerParam
https://bugzilla.gnome.org/show_bug.cgi?id=677465
-rw-r--r--libempathy-gtk/empathy-account-widget.c9
-rw-r--r--libempathy/empathy-account-settings.c39
-rw-r--r--libempathy/empathy-account-settings.h2
3 files changed, 16 insertions, 34 deletions
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c
index 1082a9eea..d5a925b75 100644
--- a/libempathy-gtk/empathy-account-widget.c
+++ b/libempathy-gtk/empathy-account-widget.c
@@ -728,13 +728,14 @@ accounts_widget_generic_setup (EmpathyAccountWidget *self,
GtkWidget *grid_common_settings,
GtkWidget *grid_advanced_settings)
{
- TpConnectionManagerParam *params, *param;
+ GList *params, *l;
guint row_common = 0, row_advanced = 0;
- params = empathy_account_settings_get_tp_params (self->priv->settings);
+ params = empathy_account_settings_dup_tp_params (self->priv->settings);
- for (param = params; param != NULL && param->name != NULL; param++)
+ for (l = params; l != NULL; l = g_list_next (l))
{
+ TpConnectionManagerParam *param = l->data;
GtkWidget *grid_settings;
guint row;
GtkWidget *widget = NULL;
@@ -848,6 +849,8 @@ accounts_widget_generic_setup (EmpathyAccountWidget *self,
g_free (param_name_formatted);
}
+
+ g_list_free_full (params, (GDestroyNotify) tp_connection_manager_param_free);
}
static void
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 (