From 8a01ae27024dc0020b0c01a95cc08b4b3baa1e10 Mon Sep 17 00:00:00 2001 From: Hans Petter Jansson Date: Wed, 21 Apr 2004 05:17:26 +0000 Subject: Remove unused fields. 2004-04-21 Hans Petter Jansson * gui/contact-editor/e-contact-editor.h (EContactEditor): Remove unused fields. * gui/contact-editor/e-contact-editor.c (emails): Remove. (e_contact_editor_init): Don't init unused fields. (e_contact_editor_dispose): Don't free/clear unused fields. (enable_writable_fields): Don't use email_choice anymore. Enable checkbutton-htmlmail only once. svn path=/trunk/; revision=25550 --- addressbook/ChangeLog | 11 ++++ addressbook/gui/contact-editor/e-contact-editor.c | 74 +---------------------- addressbook/gui/contact-editor/e-contact-editor.h | 16 ----- 3 files changed, 13 insertions(+), 88 deletions(-) diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index e9c6deb499..1d4322a017 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,14 @@ +2004-04-21 Hans Petter Jansson + + * gui/contact-editor/e-contact-editor.h (EContactEditor): Remove + unused fields. + + * gui/contact-editor/e-contact-editor.c (emails): Remove. + (e_contact_editor_init): Don't init unused fields. + (e_contact_editor_dispose): Don't free/clear unused fields. + (enable_writable_fields): Don't use email_choice anymore. Enable + checkbutton-htmlmail only once. + 2004-04-21 Hans Petter Jansson * gui/contact-editor/contact-editor.glade: Make the phone type diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index b06269877a..d35577912b 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -147,12 +147,6 @@ phones [] = { { E_CONTACT_PHONE_TTYTDD, EVC_X_TTYTDD, NULL } }; -static EContactField emails[] = { - E_CONTACT_EMAIL_1, - E_CONTACT_EMAIL_2, - E_CONTACT_EMAIL_3 -}; - static EContactField addresses[] = { E_CONTACT_ADDRESS_WORK, E_CONTACT_ADDRESS_HOME, @@ -1716,26 +1710,9 @@ e_contact_editor_init (EContactEditor *e_contact_editor) GtkWidget *wants_html; char *icon_path; - e_contact_editor->email_info = NULL; - e_contact_editor->phone_info = NULL; - e_contact_editor->address_info = NULL; - e_contact_editor->email_popup = NULL; - e_contact_editor->phone_popup = NULL; - e_contact_editor->address_popup = NULL; - e_contact_editor->email_list = NULL; - e_contact_editor->phone_list = NULL; - e_contact_editor->address_list = NULL; e_contact_editor->name = e_contact_name_new(); e_contact_editor->company = g_strdup(""); - e_contact_editor->email_choice = 0; - e_contact_editor->phone_choice[0] = 1; /* E_CONTACT_PHONE_BUSINESS */ - e_contact_editor->phone_choice[1] = 7; /* E_CONTACT_PHONE_HOME */ - e_contact_editor->phone_choice[2] = 3; /* E_CONTACT_PHONE_BUSINESS_FAX */ - e_contact_editor->phone_choice[3] = 11; /* E_CONTACT_PHONE_MOBILE */ - e_contact_editor->address_choice = 0; - e_contact_editor->address_mailing = -1; - e_contact_editor->contact = NULL; e_contact_editor->changed = FALSE; e_contact_editor->image_set = FALSE; @@ -1809,47 +1786,6 @@ e_contact_editor_dispose (GObject *object) g_object_unref(e_contact_editor->writable_fields); e_contact_editor->writable_fields = NULL; } - if (e_contact_editor->email_list) { - g_list_foreach(e_contact_editor->email_list, (GFunc) g_free, NULL); - g_list_free(e_contact_editor->email_list); - e_contact_editor->email_list = NULL; - } - if (e_contact_editor->email_info) { - g_free(e_contact_editor->email_info); - e_contact_editor->email_info = NULL; - } - if (e_contact_editor->email_popup) { - g_object_unref(e_contact_editor->email_popup); - e_contact_editor->email_popup = NULL; - } - - if (e_contact_editor->phone_list) { - g_list_foreach(e_contact_editor->phone_list, (GFunc) g_free, NULL); - g_list_free(e_contact_editor->phone_list); - e_contact_editor->phone_list = NULL; - } - if (e_contact_editor->phone_info) { - g_free(e_contact_editor->phone_info); - e_contact_editor->phone_info = NULL; - } - if (e_contact_editor->phone_popup) { - g_object_unref(e_contact_editor->phone_popup); - e_contact_editor->phone_popup = NULL; - } - - if (e_contact_editor->address_list) { - g_list_foreach(e_contact_editor->address_list, (GFunc) g_free, NULL); - g_list_free(e_contact_editor->address_list); - e_contact_editor->address_list = NULL; - } - if (e_contact_editor->address_info) { - g_free(e_contact_editor->address_info); - e_contact_editor->address_info = NULL; - } - if (e_contact_editor->address_popup) { - g_object_unref(e_contact_editor->address_popup); - e_contact_editor->address_popup = NULL; - } if (e_contact_editor->contact) { g_object_unref(e_contact_editor->contact); @@ -2324,16 +2260,10 @@ enable_writable_fields(EContactEditor *editor) editor->address_editable [i] = TRUE; } } - - /* ugh - this is needed to make sure we don't have a - disabled label next to a drop down when the item in - the menu (the one reflected in the label) is - enabled. */ - if (!strcmp (field, e_contact_field_name (emails[editor->email_choice]))) { - enable_widget (glade_xml_get_widget (editor->gui, "checkbutton-htmlmail"), editor->target_editable); - } } + enable_widget (glade_xml_get_widget (editor->gui, "checkbutton-htmlmail"), editor->target_editable); + /* handle the label next to the dropdown widgets */ for (i = 0; i < num_widget_field_mappings; i ++) { diff --git a/addressbook/gui/contact-editor/e-contact-editor.h b/addressbook/gui/contact-editor/e-contact-editor.h index 10d2567cba..a34c19e031 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.h +++ b/addressbook/gui/contact-editor/e-contact-editor.h @@ -68,26 +68,10 @@ struct _EContactEditor GladeXML *gui; GtkWidget *app; - GnomeUIInfo *email_info; - GnomeUIInfo *phone_info; - GnomeUIInfo *address_info; - GtkWidget *email_popup; - GtkWidget *phone_popup; - GtkWidget *address_popup; - GList *email_list; - GList *phone_list; - GList *address_list; EContactName *name; char *company; - GtkListStore *im_model; - - EContactField email_choice; - EContactField phone_choice[4]; - EContactField address_choice; - EContactField address_mailing; - /* Whether we are editing a new contact or an existing one */ guint is_new_contact : 1; -- cgit v1.2.3