]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-account-widget.c
de.po: Updated German translation
[empathy.git] / libempathy-gtk / empathy-account-widget.c
index 044e4f7e0dd026d0e2259349d101191fe4c7a5c1..b48d19e533b0d4b63e9988df612ae9cdb22c566b 100644 (file)
@@ -27,7 +27,7 @@
 #include <string.h>
 
 #include <gtk/gtk.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
 
 #include <libmissioncontrol/mc-account.h>
 #include <libmissioncontrol/mc-protocol.h>
@@ -51,7 +51,7 @@ account_widget_entry_focus_cb (GtkWidget     *widget,
        str = gtk_entry_get_text (GTK_ENTRY (widget));
        param_name = g_object_get_data (G_OBJECT (widget), "param_name");
 
-       if (G_STR_EMPTY (str)) {
+       if (EMP_STR_EMPTY (str)) {
                gchar *value = NULL;
 
                mc_account_unset_param (account, param_name);
@@ -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;
@@ -158,7 +154,7 @@ account_widget_password_changed_cb (GtkWidget *entry,
        const gchar *str;
 
        str = gtk_entry_get_text (GTK_ENTRY (entry));
-       gtk_widget_set_sensitive (button, !G_STR_EMPTY (str));
+       gtk_widget_set_sensitive (button, !EMP_STR_EMPTY (str));
 }
 
 static void  
@@ -449,7 +445,7 @@ empathy_account_widget_add_forget_button (McAccount   *account,
        entry_password = glade_xml_get_widget (glade, entry);
 
        mc_account_get_param_string (account, "password", &password);
-       gtk_widget_set_sensitive (button_forget, !G_STR_EMPTY (password));
+       gtk_widget_set_sensitive (button_forget, !EMP_STR_EMPTY (password));
        g_free (password);
 
        g_signal_connect (button_forget, "clicked",
@@ -697,7 +693,6 @@ empathy_account_widget_yahoo_new (McAccount *account)
                        "entry_id", "account",
                        "entry_password", "password",
                        "entry_server", "server",
-                       "entry_serverjp", "serverjp",
                        "entry_locale", "room-list-locale",
                        "entry_charset", "charset",
                        "spinbutton_port", "port",