From 8e1a4026c9c7a37e8c8fa17af647fb99ebaa1f33 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 29 Jan 2001 00:18:43 +0000 Subject: Use UTF-8. (set_defaults): Use UTF-8 and also fixed a memory leak by 2001-01-28 Jeffrey Stedfast * mail-config-druid.c (management_prepare): Use UTF-8. (set_defaults): Use UTF-8 and also fixed a memory leak by freeing the string returned by g_get_real_name(). (mail_config_druid_get_account_name): Use UTF-8. (mail_config_druid_get_full_name): Same. (mail_config_druid_get_email_address): Same. (mail_config_druid_get_organization): Same. * mail-account-editor.c (apply_changes): Save UTF-8 strings rather than gtk strings. (construct): Use the UTF-8 convenience functions to set the gtk entries for the ID fields. svn path=/trunk/; revision=7881 --- mail/mail-account-editor.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'mail/mail-account-editor.c') diff --git a/mail/mail-account-editor.c b/mail/mail-account-editor.c index 86ebe95d2d..339d6cc737 100644 --- a/mail/mail-account-editor.c +++ b/mail/mail-account-editor.c @@ -26,6 +26,7 @@ #include #include #include +#include static void mail_account_editor_class_init (MailAccountEditorClass *class); static void mail_account_editor_init (MailAccountEditor *editor); @@ -117,24 +118,24 @@ apply_changes (MailAccountEditor *editor) /* account name */ if (editor->account_name) { g_free (account->name); - account->name = g_strdup (gtk_entry_get_text (editor->account_name)); + account->name = e_utf8_gtk_entry_get_text (editor->account_name); } /* identity info */ g_free (account->id->name); - account->id->name = g_strdup (gtk_entry_get_text (editor->name)); + account->id->name = e_utf8_gtk_entry_get_text (editor->name); g_free (account->id->address); - account->id->address = g_strdup (gtk_entry_get_text (editor->email)); + account->id->address = e_utf8_gtk_entry_get_text (editor->email); if (editor->reply_to) { g_free (account->id->reply_to); - account->id->reply_to = g_strdup (gtk_entry_get_text (editor->reply_to)); + account->id->reply_to = e_utf8_gtk_entry_get_text (editor->reply_to); } if (editor->organization) { g_free (account->id->organization); - account->id->organization = g_strdup (gtk_entry_get_text (editor->organization)); + account->id->organization = e_utf8_gtk_entry_get_text (editor->organization); } if (editor->signature) { @@ -643,20 +644,20 @@ construct (MailAccountEditor *editor, const MailConfigAccount *account) /* General */ editor->account_name = GTK_ENTRY (glade_xml_get_widget (gui, "txtAccountName")); - gtk_entry_set_text (editor->account_name, account->name); + e_utf8_gtk_entry_set_text (editor->account_name, account->name); gtk_signal_connect (GTK_OBJECT (editor->account_name), "changed", entry_changed, editor); editor->name = GTK_ENTRY (glade_xml_get_widget (gui, "txtName")); - gtk_entry_set_text (editor->name, account->id->name); + e_utf8_gtk_entry_set_text (editor->name, account->id->name); gtk_signal_connect (GTK_OBJECT (editor->name), "changed", entry_changed, editor); editor->email = GTK_ENTRY (glade_xml_get_widget (gui, "txtAddress")); - gtk_entry_set_text (editor->email, account->id->address); + e_utf8_gtk_entry_set_text (editor->email, account->id->address); gtk_signal_connect (GTK_OBJECT (editor->email), "changed", entry_changed, editor); editor->reply_to = GTK_ENTRY (glade_xml_get_widget (gui, "txtReplyTo")); if (editor->reply_to) - gtk_entry_set_text (editor->reply_to, account->id->reply_to ? account->id->reply_to : ""); + e_utf8_gtk_entry_set_text (editor->reply_to, account->id->reply_to ? account->id->reply_to : ""); editor->organization = GTK_ENTRY (glade_xml_get_widget (gui, "txtOrganization")); if (editor->organization) - gtk_entry_set_text (editor->organization, account->id->organization); + e_utf8_gtk_entry_set_text (editor->organization, account->id->organization); editor->signature = GNOME_FILE_ENTRY (glade_xml_get_widget (gui, "fileSignature")); if (editor->signature) { entry = gnome_file_entry_gtk_entry (editor->signature); -- cgit v1.2.3