diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2008-07-04 22:49:23 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-07-04 22:49:23 +0800 |
commit | 04b2fab050f45e2fc668c9e33ef7a48dd2ee01f7 (patch) | |
tree | 2887175b431b2cd1d3ec8e15726f5aa56a5ba10a /libempathy-gtk | |
parent | 1f4625e9634adb6bd6c03c9890e0f9b2fb898bce (diff) | |
download | gsoc2013-empathy-04b2fab050f45e2fc668c9e33ef7a48dd2ee01f7.tar gsoc2013-empathy-04b2fab050f45e2fc668c9e33ef7a48dd2ee01f7.tar.gz gsoc2013-empathy-04b2fab050f45e2fc668c9e33ef7a48dd2ee01f7.tar.bz2 gsoc2013-empathy-04b2fab050f45e2fc668c9e33ef7a48dd2ee01f7.tar.lz gsoc2013-empathy-04b2fab050f45e2fc668c9e33ef7a48dd2ee01f7.tar.xz gsoc2013-empathy-04b2fab050f45e2fc668c9e33ef7a48dd2ee01f7.tar.zst gsoc2013-empathy-04b2fab050f45e2fc668c9e33ef7a48dd2ee01f7.zip |
Unref profile and improve a bit default account domain code.
svn path=/trunk/; revision=1194
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-account-widget.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c index 044e4f7e0..cf01f899f 100644 --- a/libempathy-gtk/empathy-account-widget.c +++ b/libempathy-gtk/empathy-account-widget.c @@ -60,31 +60,27 @@ account_widget_entry_focus_cb (GtkWidget *widget, gtk_entry_set_text (GTK_ENTRY (widget), value ? value : ""); g_free (value); } else { - McProfile *profile; - const gchar *default_account_domain = NULL; - gchar *value = NULL; + McProfile *profile; + const gchar *domain = NULL; + gchar *dup_str = NULL; profile = mc_account_get_profile (account); if (mc_profile_get_capabilities (profile) & - MC_PROFILE_CAPABILITY_SPLIT_ACCOUNT) { - - default_account_domain = mc_profile_get_default_account_domain (profile); + MC_PROFILE_CAPABILITY_SPLIT_ACCOUNT) { + domain = mc_profile_get_default_account_domain (profile); } - if ((strcmp (param_name, "account") == 0) && default_account_domain && - !strstr (str, "@")) { - - DEBUG ("Adding @%s suffix to account", - default_account_domain); - value = g_strconcat (str, "@", default_account_domain, NULL); - gtk_entry_set_text (GTK_ENTRY (widget), value); - } else { - value = g_strdup (str); + if (domain && !strstr (str, "@") && + strcmp (param_name, "account") == 0) { + DEBUG ("Adding @%s suffix to account", domain); + str = dup_str = g_strconcat (str, "@", domain, NULL); + gtk_entry_set_text (GTK_ENTRY (widget), str); } DEBUG ("Setting %s to %s", param_name, - strstr (param_name, "password") ? "***" : value); - mc_account_set_param_string (account, param_name, value); - g_free (value); + strstr (param_name, "password") ? "***" : str); + mc_account_set_param_string (account, param_name, str); + g_free (dup_str); + g_object_unref (profile); } return FALSE; |