From f9b9d73b82f4eb6568593722af134f32b98d9b57 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Thu, 11 Oct 2001 22:39:22 +0000 Subject: Changed these to use the new ref and unref functions for ECard auxillary 2001-10-11 Christopher James Lahey * backend/ebook/e-card-simple.c (e_card_simple_destroy, fill_in_info, e_card_simple_sync_card, e_card_simple_set_phone, e_card_simple_set_address, e_card_simple_set_delivery_address, file_as_get_style, file_as_set_style, e_card_simple_set, e_card_simple_set_arbitrary), gui/contact-editor/e-contact-editor-address.c (e_contact_editor_address_destroy, e_contact_editor_address_set_arg, e_contact_editor_address_get_arg), gui/contact-editor/e-contact-editor-fullname.c (e_contact_editor_fullname_destroy, e_contact_editor_fullname_set_arg, e_contact_editor_fullname_get_arg), gui/contact-editor/e-contact-editor.c (phone_entry_changed, address_text_changed, name_entry_changed, full_name_clicked, full_addr_clicked, fill_in_info): Changed these to use the new ref and unref functions for ECard auxillary types. * backend/ebook/e-card-simple.h: Added a comment. * backend/ebook/e-card-types.h: Added ref_count field to all the types. * backend/ebook/e-card.c, backend/ebook/e-card.h: Added ref and unref functions here for all the ECard auxillary types. Removed the corresponding free functions. Switched to using these functions where appropriate. * gui/component/addressbook-factory.c: #include * gui/component/addressbook.c (load_uri_cb): const correctify. * gui/component/select-names/e-select-names-manager.c, gui/component/select-names/e-select-names.c: #include * gui/widgets/e-addressbook-model.c (modify_card): Removed an unnecessary ref here. svn path=/trunk/; revision=13604 --- addressbook/gui/component/addressbook-factory.c | 1 + addressbook/gui/component/addressbook.c | 11 ++++++----- .../gui/component/select-names/e-select-names-manager.c | 1 + addressbook/gui/component/select-names/e-select-names.c | 1 + 4 files changed, 9 insertions(+), 5 deletions(-) (limited to 'addressbook/gui/component') diff --git a/addressbook/gui/component/addressbook-factory.c b/addressbook/gui/component/addressbook-factory.c index 1719c4fd8f..c941cbf24d 100644 --- a/addressbook/gui/component/addressbook-factory.c +++ b/addressbook/gui/component/addressbook-factory.c @@ -17,6 +17,7 @@ #include #include #include +#include #include diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index 8dc978f603..41b2ff7396 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -603,7 +603,8 @@ load_uri_cb (EBook *book, EBookStatus status, gpointer closure) if (source && source->type == ADDRESSBOOK_SOURCE_LDAP && source->auth == ADDRESSBOOK_LDAP_AUTH_SIMPLE) { - char *password; + const char *password; + char *pass_dup = NULL; password = e_passwords_get_password(load_uri_data->uri); @@ -613,7 +614,7 @@ load_uri_cb (EBook *book, EBookStatus status, gpointer closure) prompt = g_strdup_printf (_("Enter password for %s (user %s)"), source->name, source->email_addr); remember = source->remember_passwd; - password = e_passwords_ask_password ( + pass_dup = e_passwords_ask_password ( prompt, load_uri_data->uri, prompt, TRUE, E_PASSWORDS_REMEMBER_FOREVER, &remember, NULL); @@ -624,10 +625,10 @@ load_uri_cb (EBook *book, EBookStatus status, gpointer closure) g_free (prompt); } - if (password) { - e_book_authenticate_user (book, source->email_addr, password, + if (password || pass_dup) { + e_book_authenticate_user (book, source->email_addr, password ? password : pass_dup, load_uri_auth_cb, closure); - g_free (password); + g_free (pass_dup); return; } } diff --git a/addressbook/gui/component/select-names/e-select-names-manager.c b/addressbook/gui/component/select-names/e-select-names-manager.c index 5820a2bf52..d392930570 100644 --- a/addressbook/gui/component/select-names/e-select-names-manager.c +++ b/addressbook/gui/component/select-names/e-select-names-manager.c @@ -21,6 +21,7 @@ #include "e-select-names-completion.h" #include "e-select-names-popup.h" #include +#include #include #include #include diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c index de592dc01e..0befe02ffc 100644 --- a/addressbook/gui/component/select-names/e-select-names.c +++ b/addressbook/gui/component/select-names/e-select-names.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include "e-select-names.h" -- cgit