aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-10-19 18:58:52 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-10-19 19:10:11 +0800
commit98241a08a60d0741e6d00f52775ccad85d6693c3 (patch)
tree685e60714b47b9b234c559803b19ee0e041d1a10 /libempathy
parent395532bc9175deaac84c5ebbea9e6fc2b215286f (diff)
downloadgsoc2013-empathy-98241a08a60d0741e6d00f52775ccad85d6693c3.tar
gsoc2013-empathy-98241a08a60d0741e6d00f52775ccad85d6693c3.tar.gz
gsoc2013-empathy-98241a08a60d0741e6d00f52775ccad85d6693c3.tar.bz2
gsoc2013-empathy-98241a08a60d0741e6d00f52775ccad85d6693c3.tar.lz
gsoc2013-empathy-98241a08a60d0741e6d00f52775ccad85d6693c3.tar.xz
gsoc2013-empathy-98241a08a60d0741e6d00f52775ccad85d6693c3.tar.zst
gsoc2013-empathy-98241a08a60d0741e6d00f52775ccad85d6693c3.zip
empathy-account-settings: don't cache the TpConnectionManagerProtocol
The result of tp_connection_manager_get_protocol isn't garanteed to be valid after the main loop re-entered. We can't cache it in the account settings and so have to request it each time we need it.
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-account-settings.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/libempathy/empathy-account-settings.c b/libempathy/empathy-account-settings.c
index 33029a9d9..ea5a1e618 100644
--- a/libempathy/empathy-account-settings.c
+++ b/libempathy/empathy-account-settings.c
@@ -55,7 +55,6 @@ struct _EmpathyAccountSettingsPriv
gulong account_manager_ready_id;
TpConnectionManager *manager;
- const TpConnectionManagerProtocol *tp_protocol;
EmpathyAccount *account;
gchar *cm_name;
@@ -353,6 +352,7 @@ static void
empathy_account_settings_check_readyness (EmpathyAccountSettings *self)
{
EmpathyAccountSettingsPriv *priv = GET_PRIV (self);
+ const TpConnectionManagerProtocol *tp_protocol;
if (priv->ready)
return;
@@ -380,10 +380,10 @@ empathy_account_settings_check_readyness (EmpathyAccountSettings *self)
g_strdup (empathy_account_get_icon_name (priv->account));
}
- priv->tp_protocol = tp_connection_manager_get_protocol (priv->manager,
+ tp_protocol = tp_connection_manager_get_protocol (priv->manager,
priv->protocol);
- if (priv->tp_protocol == NULL)
+ if (tp_protocol == NULL)
{
priv->manager = NULL;
return;
@@ -396,7 +396,7 @@ empathy_account_settings_check_readyness (EmpathyAccountSettings *self)
priv->required_params = g_array_new (TRUE, FALSE, sizeof (gchar *));
- for (cur = priv->tp_protocol->params; cur->name != NULL; cur++)
+ for (cur = tp_protocol->params; cur->name != NULL; cur++)
{
if (tp_connection_manager_param_is_required (cur))
{
@@ -446,10 +446,16 @@ TpConnectionManagerParam *
empathy_account_settings_get_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->tp_protocol != NULL, NULL);
+ tp_protocol = tp_connection_manager_get_protocol (priv->manager,
+ priv->protocol);
+ g_return_val_if_fail (tp_protocol != NULL, NULL);
- return priv->tp_protocol->params;
+ return tp_protocol->params;
}
gboolean