aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-04-09 16:01:45 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-04-09 18:53:51 +0800
commit6cdc040da5561c019ed87cc0a3c6ac10eb5b9223 (patch)
tree4b8bb77bfd8a346bee2339f84fc18a8cd5493d25
parentc8ed0aa2975b0e549e28c5e65d262e362a94c507 (diff)
downloadgsoc2013-empathy-6cdc040da5561c019ed87cc0a3c6ac10eb5b9223.tar
gsoc2013-empathy-6cdc040da5561c019ed87cc0a3c6ac10eb5b9223.tar.gz
gsoc2013-empathy-6cdc040da5561c019ed87cc0a3c6ac10eb5b9223.tar.bz2
gsoc2013-empathy-6cdc040da5561c019ed87cc0a3c6ac10eb5b9223.tar.lz
gsoc2013-empathy-6cdc040da5561c019ed87cc0a3c6ac10eb5b9223.tar.xz
gsoc2013-empathy-6cdc040da5561c019ed87cc0a3c6ac10eb5b9223.tar.zst
gsoc2013-empathy-6cdc040da5561c019ed87cc0a3c6ac10eb5b9223.zip
account_assistant_apply_account_and_finish: explicitely ask to set the display name
Checking if priv->current_widget_object is NULL or not isn't right because if we create a normal account before the Salut one, this pointer is not NULL and we rename the Salut account to the same name that the standard one. This patch adds an extra argument account_assistant_apply_account_and_finish saying if we should set a new display name or not. It's more clear and avoid to rely on side effects. Fixes bug #615058
-rw-r--r--src/empathy-account-assistant.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/empathy-account-assistant.c b/src/empathy-account-assistant.c
index 9860259fa..f516692b9 100644
--- a/src/empathy-account-assistant.c
+++ b/src/empathy-account-assistant.c
@@ -339,7 +339,8 @@ account_assistant_apply_account_cb (GObject *source,
static void
account_assistant_apply_account_and_finish (EmpathyAccountAssistant *self,
- EmpathyAccountSettings *settings)
+ EmpathyAccountSettings *settings,
+ gboolean set_display_name)
{
EmpathyAccountAssistantPriv *priv = GET_PRIV (self);
@@ -348,9 +349,7 @@ account_assistant_apply_account_and_finish (EmpathyAccountAssistant *self,
priv->is_creating = TRUE;
- /* set default display name, if there is no current widget then assume the
- * display name was already set correctly. e.g. salut account creation */
- if (priv->current_widget_object != NULL)
+ if (set_display_name)
{
gchar *display_name;
@@ -896,14 +895,17 @@ impl_signal_apply (GtkAssistant *assistant)
if (current_page == PAGE_SALUT)
{
if (priv->create_salut_account)
- account_assistant_apply_account_and_finish (self, priv->salut_settings);
+ /* create_salut_account_settings() already set the display name of the
+ * account so there is no need to set it again. */
+ account_assistant_apply_account_and_finish (self, priv->salut_settings,
+ FALSE);
return;
}
else if (current_page == PAGE_ENTER_CREATE &&
priv->settings != NULL &&
empathy_account_settings_is_valid (priv->settings))
{
- account_assistant_apply_account_and_finish (self, priv->settings);
+ account_assistant_apply_account_and_finish (self, priv->settings, TRUE);
}
}
@@ -948,7 +950,8 @@ impl_signal_prepare (GtkAssistant *assistant,
if (priv->settings != NULL &&
empathy_account_settings_is_valid (priv->settings))
{
- account_assistant_apply_account_and_finish (self, priv->settings);
+ account_assistant_apply_account_and_finish (self, priv->settings,
+ TRUE);
g_object_unref (priv->settings);
priv->settings = NULL;
}