diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-05-07 05:31:45 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-05-07 05:31:45 +0800 |
commit | 989f36ec0e0a0a835c30d521ffe77d70dd7fa321 (patch) | |
tree | cab36b6ea38ce3fd57cffc6a44470101902536f4 /addressbook/contact-editor | |
parent | 073f72e4f3827d51331cecf6800ae811b4776a08 (diff) | |
download | gsoc2013-evolution-989f36ec0e0a0a835c30d521ffe77d70dd7fa321.tar gsoc2013-evolution-989f36ec0e0a0a835c30d521ffe77d70dd7fa321.tar.gz gsoc2013-evolution-989f36ec0e0a0a835c30d521ffe77d70dd7fa321.tar.bz2 gsoc2013-evolution-989f36ec0e0a0a835c30d521ffe77d70dd7fa321.tar.lz gsoc2013-evolution-989f36ec0e0a0a835c30d521ffe77d70dd7fa321.tar.xz gsoc2013-evolution-989f36ec0e0a0a835c30d521ffe77d70dd7fa321.tar.zst gsoc2013-evolution-989f36ec0e0a0a835c30d521ffe77d70dd7fa321.zip |
Mostly finished ECardSimple.
2000-05-06 Christopher James Lahey <clahey@helixcode.com>
* backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h:
Mostly finished ECardSimple.
* contact-editor/e-contact-editor.c: Changed this to match with
some of the changes to ECardSimple.
* gui/component/addressbook.c: Changed this to look for
"addressbook.db" in the given directory if it doesn't find the
file "uri".
* gui/minicard/e-minicard.c, gui/minicard/e-minicard.h: Changed
this to use ECardSimple.
svn path=/trunk/; revision=2839
Diffstat (limited to 'addressbook/contact-editor')
-rw-r--r-- | addressbook/contact-editor/e-contact-editor.c | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/addressbook/contact-editor/e-contact-editor.c b/addressbook/contact-editor/e-contact-editor.c index 42e1759bea..6205ecdcc6 100644 --- a/addressbook/contact-editor/e-contact-editor.c +++ b/addressbook/contact-editor/e-contact-editor.c @@ -188,16 +188,11 @@ phone_entry_changed (GtkWidget *widget, EContactEditor *editor) } else return; string = gtk_entry_get_text(entry); - phone = e_card_simple_get_phone(editor->simple, editor->phone_choice[which - 1]); - if (phone) { - g_free(phone->number); - } else { - phone = e_card_phone_new(); - e_card_simple_set_phone(editor->simple, editor->phone_choice[which - 1], phone); - e_card_phone_free(phone); - phone = e_card_simple_get_phone(editor->simple, editor->phone_choice[which - 1]); - } - phone->number = g_strdup(string); + phone = e_card_phone_new(); + phone->number = string; + e_card_simple_set_phone(editor->simple, editor->phone_choice[which - 1], phone); + phone->number = NULL; + e_card_phone_free(phone); set_fields(editor); } @@ -215,24 +210,16 @@ email_entry_changed (GtkWidget *widget, EContactEditor *editor) static void address_text_changed (GtkWidget *widget, EContactEditor *editor) { - gchar *string; GtkEditable *editable = GTK_EDITABLE(widget); ECardAddrLabel *address; if (editor->address_choice == -1) return; - address = e_card_simple_get_address(editor->simple, editor->address_choice); - if (address) { - g_free(address->data); - } else { - address = e_card_address_label_new(); - e_card_simple_set_address(editor->simple, editor->address_choice, address); - e_card_address_label_free(address); - address = e_card_simple_get_address(editor->simple, editor->address_choice); - } - string = gtk_editable_get_chars(editable, 0, -1); - address->data = string; + address = e_card_address_label_new(); + address->data = gtk_editable_get_chars(editable, 0, -1); + e_card_simple_set_address(editor->simple, editor->address_choice, address); + e_card_address_label_free(address); } /* This function tells you whether name_to_style will make sense. */ @@ -944,7 +931,7 @@ set_address_field(EContactEditor *editor, int result) { GtkEditable *editable; int position; - ECardAddrLabel *address; + const ECardAddrLabel *address; if (result == -1) result = editor->address_choice; editor->address_choice = -1; |