[empathy: 3/5] account-widget: try to guess if the display name has been manually changed by the user



commit b0ef41dd204e2841a3f1eeb6c5dca709f2e725b1
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Wed Mar 3 11:45:39 2010 +0100

    account-widget: try to guess if the display name has been manually changed by the user

 libempathy-gtk/empathy-account-widget.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c
index 3908849..3b87410 100644
--- a/libempathy-gtk/empathy-account-widget.c
+++ b/libempathy-gtk/empathy-account-widget.c
@@ -1631,6 +1631,7 @@ do_constructed (GObject *obj)
   EmpathyAccountWidgetPriv *priv = GET_PRIV (self);
   TpAccount *account;
   const gchar *protocol, *cm_name;
+  const gchar *display_name, *default_display_name;
   guint i = 0;
   struct {
     const gchar *cm_name;
@@ -1780,6 +1781,16 @@ do_constructed (GObject *obj)
   empathy_builder_unref_and_keep_widget (self->ui_details->gui,
       self->ui_details->widget);
   self->ui_details->gui = NULL;
+
+  display_name = empathy_account_settings_get_display_name (priv->settings);
+  default_display_name = empathy_account_widget_get_default_display_name (self);
+
+  if (tp_strdiff (display_name, default_display_name))
+    {
+      /* The display name of the account is not the one that we'd assign by
+       * default; assume that the user changed it manually */
+      g_object_set (priv->settings, "display-name-overridden", TRUE, NULL);
+    }
 }
 
 static void



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