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.
gulong account_manager_ready_id;
TpConnectionManager *manager;
gulong account_manager_ready_id;
TpConnectionManager *manager;
- const TpConnectionManagerProtocol *tp_protocol;
EmpathyAccount *account;
gchar *cm_name;
EmpathyAccount *account;
gchar *cm_name;
empathy_account_settings_check_readyness (EmpathyAccountSettings *self)
{
EmpathyAccountSettingsPriv *priv = GET_PRIV (self);
empathy_account_settings_check_readyness (EmpathyAccountSettings *self)
{
EmpathyAccountSettingsPriv *priv = GET_PRIV (self);
+ const TpConnectionManagerProtocol *tp_protocol;
g_strdup (empathy_account_get_icon_name (priv->account));
}
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,
- if (priv->tp_protocol == NULL)
+ if (tp_protocol == NULL)
{
priv->manager = NULL;
return;
{
priv->manager = NULL;
return;
priv->required_params = g_array_new (TRUE, FALSE, sizeof (gchar *));
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))
{
{
if (tp_connection_manager_param_is_required (cur))
{
empathy_account_settings_get_tp_params (EmpathyAccountSettings *settings)
{
EmpathyAccountSettingsPriv *priv = GET_PRIV (settings);
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;