diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-01-29 08:18:43 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-01-29 08:18:43 +0800 |
commit | 8e1a4026c9c7a37e8c8fa17af647fb99ebaa1f33 (patch) | |
tree | 870e8ba249aa39be9b91bca48dec2db0277328e2 | |
parent | 5393a574bf5971a698475d6a637a31c7f0fef03b (diff) | |
download | gsoc2013-evolution-8e1a4026c9c7a37e8c8fa17af647fb99ebaa1f33.tar gsoc2013-evolution-8e1a4026c9c7a37e8c8fa17af647fb99ebaa1f33.tar.gz gsoc2013-evolution-8e1a4026c9c7a37e8c8fa17af647fb99ebaa1f33.tar.bz2 gsoc2013-evolution-8e1a4026c9c7a37e8c8fa17af647fb99ebaa1f33.tar.lz gsoc2013-evolution-8e1a4026c9c7a37e8c8fa17af647fb99ebaa1f33.tar.xz gsoc2013-evolution-8e1a4026c9c7a37e8c8fa17af647fb99ebaa1f33.tar.zst gsoc2013-evolution-8e1a4026c9c7a37e8c8fa17af647fb99ebaa1f33.zip |
Use UTF-8. (set_defaults): Use UTF-8 and also fixed a memory leak by
2001-01-28 Jeffrey Stedfast <fejj@ximian.com>
* 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
-rw-r--r-- | mail/ChangeLog | 15 | ||||
-rw-r--r-- | mail/mail-account-editor.c | 21 | ||||
-rw-r--r-- | mail/mail-config-druid.c | 25 |
3 files changed, 41 insertions, 20 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index efb7a36e96..41c7fc36c0 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,18 @@ +2001-01-28 Jeffrey Stedfast <fejj@ximian.com> + + * 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. + 2001-01-28 Ettore Perazzoli <ettore@ximian.com> * mail-vfolder.c (vfolder_gui_add_rule): Make the OK button the 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 <stdlib.h> #include <string.h> #include <camel/camel-url.h> +#include <gal/widgets/e-unicode.h> 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); diff --git a/mail/mail-config-druid.c b/mail/mail-config-druid.c index 954dafe4be..908eb01498 100644 --- a/mail/mail-config-druid.c +++ b/mail/mail-config-druid.c @@ -24,6 +24,7 @@ #include <glade/glade.h> #include <gtkhtml/gtkhtml.h> +#include <gal/widgets/e-unicode.h> #include "mail-config-druid.h" #include "mail-config.h" #include "mail-ops.h" @@ -727,11 +728,13 @@ static void management_prepare (GnomeDruidPage *page, GnomeDruid *druid, gpointer data) { MailConfigDruid *config = data; - const char *name; + char *name; - name = gtk_entry_get_text (config->email_address); - if (name) - gtk_entry_set_text (config->account_name, name); + name = e_utf8_gtk_entry_get_text (config->email_address); + if (name) { + e_utf8_gtk_entry_set_text (config->account_name, name); + g_free (name); + } management_check (config); } @@ -780,8 +783,10 @@ set_defaults (MailConfigDruid *druid) /* set the default Name field */ realname = g_get_real_name (); - if (realname) - gtk_entry_set_text (druid->full_name, realname); + if (realname) { + e_utf8_gtk_entry_set_text (druid->full_name, realname); + g_free (realname); + } /* set the default E-Mail Address field */ user = getenv ("USER"); @@ -1079,7 +1084,7 @@ mail_config_druid_get_account_name (MailConfigDruid *druid) { g_return_val_if_fail (IS_MAIL_CONFIG_DRUID (druid), NULL); - return g_strdup (gtk_entry_get_text (druid->account_name)); + return e_utf8_gtk_entry_get_text (druid->account_name); } @@ -1097,7 +1102,7 @@ mail_config_druid_get_full_name (MailConfigDruid *druid) { g_return_val_if_fail (IS_MAIL_CONFIG_DRUID (druid), NULL); - return g_strdup (gtk_entry_get_text (druid->full_name)); + return e_utf8_gtk_entry_get_text (druid->full_name); } @@ -1106,7 +1111,7 @@ mail_config_druid_get_email_address (MailConfigDruid *druid) { g_return_val_if_fail (IS_MAIL_CONFIG_DRUID (druid), NULL); - return g_strdup (gtk_entry_get_text (druid->email_address)); + return e_utf8_gtk_entry_get_text (druid->email_address); } @@ -1115,7 +1120,7 @@ mail_config_druid_get_organization (MailConfigDruid *druid) { g_return_val_if_fail (IS_MAIL_CONFIG_DRUID (druid), NULL); - return g_strdup (gtk_entry_get_text (druid->organization)); + return e_utf8_gtk_entry_get_text (druid->organization); } |