[empathy: 4/5] update display name after editing if it hasn't been overridden (#603463)



commit 1dab11523a8fffd546d154ca21c79a8c76d0c3c0
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Wed Mar 3 11:46:30 2010 +0100

    update display name after editing if it hasn't been overridden (#603463)

 libempathy-gtk/empathy-account-widget.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c
index 3b87410..e75c683 100644
--- a/libempathy-gtk/empathy-account-widget.c
+++ b/libempathy-gtk/empathy-account-widget.c
@@ -768,6 +768,7 @@ account_widget_apply_clicked_cb (GtkWidget *button,
     EmpathyAccountWidget *self)
 {
   EmpathyAccountWidgetPriv *priv = GET_PRIV (self);
+  gboolean display_name_overridden;
 
   if (priv->radiobutton_reuse != NULL)
     {
@@ -778,11 +779,15 @@ account_widget_apply_clicked_cb (GtkWidget *button,
       empathy_account_settings_set_boolean (priv->settings, "register", !reuse);
     }
 
-  if (priv->creating_account)
+  g_object_get (priv->settings,
+      "display-name-overridden", &display_name_overridden, NULL);
+
+  if (priv->creating_account || !display_name_overridden)
     {
       gchar *display_name;
 
-      /* set default display name */
+      /* set default display name for new accounts or update if user didn't
+       * manually override it. */
       display_name = empathy_account_widget_get_default_display_name (self);
 
       empathy_account_settings_set_display_name_async (priv->settings,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]