[empathy] accounts-dialog: set display-name before creating the account



commit 67308bd569a5a3884225b65b8514725fdf8f3117
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Wed Mar 3 10:23:01 2010 +0100

    accounts-dialog: set display-name before creating the account
    
    This saves us a D-Bus call.

 libempathy-gtk/empathy-account-widget.c |   13 +++++++++++++
 src/empathy-accounts-dialog.c           |    9 ---------
 2 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c
index 8862c3b..f2d4bbe 100644
--- a/libempathy-gtk/empathy-account-widget.c
+++ b/libempathy-gtk/empathy-account-widget.c
@@ -778,6 +778,19 @@ account_widget_apply_clicked_cb (GtkWidget *button,
       empathy_account_settings_set_boolean (priv->settings, "register", !reuse);
     }
 
+  if (priv->creating_account)
+    {
+      gchar *display_name;
+
+      /* set default display name */
+      display_name = empathy_account_widget_get_default_display_name (self);
+
+      empathy_account_settings_set_display_name_async (priv->settings,
+          display_name, NULL, NULL);
+
+      g_free (display_name);
+    }
+
   /* workaround to keep widget alive during async call */
   g_object_ref (self);
   empathy_account_settings_apply_async (priv->settings,
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index 5843c0d..d8489ee 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -398,19 +398,10 @@ empathy_account_dialog_account_created_cb (EmpathyAccountWidget *widget_object,
     TpAccount *account,
     EmpathyAccountsDialog *dialog)
 {
-  gchar *display_name;
   EmpathyAccountSettings *settings =
       accounts_dialog_model_get_selected_settings (dialog);
   EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog);
 
-  display_name = empathy_account_widget_get_default_display_name (
-      widget_object);
-
-  empathy_account_settings_set_display_name_async (settings,
-      display_name, NULL, NULL);
-
-  g_free (display_name);
-
   accounts_dialog_update_settings (dialog, settings);
   accounts_dialog_update_status_infobar (dialog,
       empathy_account_settings_get_account (settings));



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