aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-06-05 20:28:47 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-06-06 17:28:40 +0800
commitdaf7a5ba63b13dca8cd93c84ba39f722a3713b9b (patch)
tree04d641a2bc30e18173dac1cf2794b2a1c9b80cc3
parentef7ff08c2013a8c1a564bde2c16d0e20414f93c4 (diff)
downloadgsoc2013-empathy-daf7a5ba63b13dca8cd93c84ba39f722a3713b9b.tar
gsoc2013-empathy-daf7a5ba63b13dca8cd93c84ba39f722a3713b9b.tar.gz
gsoc2013-empathy-daf7a5ba63b13dca8cd93c84ba39f722a3713b9b.tar.bz2
gsoc2013-empathy-daf7a5ba63b13dca8cd93c84ba39f722a3713b9b.tar.lz
gsoc2013-empathy-daf7a5ba63b13dca8cd93c84ba39f722a3713b9b.tar.xz
gsoc2013-empathy-daf7a5ba63b13dca8cd93c84ba39f722a3713b9b.tar.zst
gsoc2013-empathy-daf7a5ba63b13dca8cd93c84ba39f722a3713b9b.zip
empathy_account_settings_check_readyness: use the existing TpProtocol to list params
No need to request another one. https://bugzilla.gnome.org/show_bug.cgi?id=677465
-rw-r--r--libempathy/empathy-account-settings.c46
1 files changed, 21 insertions, 25 deletions
diff --git a/libempathy/empathy-account-settings.c b/libempathy/empathy-account-settings.c
index 7e3a745be..f88ff3dd7 100644
--- a/libempathy/empathy-account-settings.c
+++ b/libempathy/empathy-account-settings.c
@@ -536,7 +536,6 @@ static void
empathy_account_settings_check_readyness (EmpathyAccountSettings *self)
{
EmpathyAccountSettingsPriv *priv = GET_PRIV (self);
- const TpConnectionManagerProtocol *tp_protocol;
GQuark features[] = { TP_PROTOCOL_FEATURE_CORE, 0 };
if (priv->ready)
@@ -573,34 +572,11 @@ empathy_account_settings_check_readyness (EmpathyAccountSettings *self)
priv->uri_scheme_tel = empathy_account_has_uri_scheme_tel (priv->account);
}
- tp_protocol = tp_connection_manager_get_protocol (priv->manager,
- priv->protocol);
-
- if (tp_protocol == NULL)
- {
- tp_clear_object (&priv->manager);
- return;
- }
-
- if (priv->required_params == NULL)
- {
- TpConnectionManagerParam *cur;
-
- for (cur = tp_protocol->params; cur->name != NULL; cur++)
- {
- if (tp_connection_manager_param_is_required (cur))
- {
- priv->required_params = g_list_append (priv->required_params,
- g_strdup (cur->name));
- }
- }
- }
-
if (priv->protocol_obj == NULL)
{
priv->protocol_obj = g_object_ref (
tp_connection_manager_get_protocol_object (priv->manager,
- priv->protocol));
+ priv->protocol));
}
if (!tp_proxy_is_prepared (priv->protocol_obj, TP_PROTOCOL_FEATURE_CORE)
@@ -621,6 +597,26 @@ empathy_account_settings_check_readyness (EmpathyAccountSettings *self)
}
}
+ if (priv->required_params == NULL)
+ {
+ GList *params, *l;
+
+ params = tp_protocol_dup_params (priv->protocol_obj);
+ for (l = params; l != NULL; l = g_list_next (l))
+ {
+ TpConnectionManagerParam *cur = l->data;
+
+ if (tp_connection_manager_param_is_required (cur))
+ {
+ priv->required_params = g_list_append (priv->required_params,
+ g_strdup (cur->name));
+ }
+ }
+
+ g_list_free_full (params,
+ (GDestroyNotify) tp_connection_manager_param_free);
+ }
+
/* NOTE: When removing MC migration code, remove this call, and the
* function it's calling. That's it. */
empathy_account_settings_try_migrating_password (self);