From 6f6fe0e2eb8d6daa5312717759beb8e128f4e567 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Sat, 10 Nov 2001 00:58:57 +0000 Subject: [ Fixes Ximian bug #14687 ] backend/pas/pas-backend-file.c 2001-11-09 Chris Toshok [ Fixes Ximian bug #14687 ] * backend/pas/pas-backend-file.c * backend/pas/pas-book-factory.c (pas_book_factory_process_request): do load_uri before add_client, so we know if the load actually worked (add_client uses this information to respond to the new client.) before this change, the client would still think the book was in a useful state even if the load_uri failed. * backend/pas/pas-backend-ldap.c (pas_backend_ldap_add_client): if the we're not connected, say so. * backend/pas/pas-backend-file.c (pas_backend_file_add_client): same. (pas_backend_file_load_uri): don't report_writable here, add_client does it. was only needed before because of the improper ordering in pas-book-factory.c above. svn path=/trunk/; revision=14655 --- addressbook/ChangeLog | 21 +++++++++++++++++++++ addressbook/backend/pas/pas-backend-file.c | 13 +------------ addressbook/backend/pas/pas-backend-ldap.c | 3 +-- addressbook/backend/pas/pas-book-factory.c | 4 ++-- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index a0fcb2b711..935ce550ac 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,24 @@ +2001-11-09 Chris Toshok + + [ Fixes Ximian bug #14687 ] + * backend/pas/pas-backend-file.c + + * backend/pas/pas-book-factory.c + (pas_book_factory_process_request): do load_uri before add_client, + so we know if the load actually worked (add_client uses this + information to respond to the new client.) before this change, + the client would still think the book was in a useful state even + if the load_uri failed. + + * backend/pas/pas-backend-ldap.c (pas_backend_ldap_add_client): if + the we're not connected, say so. + + * backend/pas/pas-backend-file.c (pas_backend_file_add_client): + same. + (pas_backend_file_load_uri): don't report_writable here, + add_client does it. was only needed before because of the + improper ordering in pas-book-factory.c above. + 2001-11-09 Chris Toshok [ Fixes Ximian bug #14646 ] diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c index 25c38888a4..56c8d545cc 100644 --- a/addressbook/backend/pas/pas-backend-file.c +++ b/addressbook/backend/pas/pas-backend-file.c @@ -1236,7 +1236,6 @@ pas_backend_file_load_uri (PASBackend *backend, PASBackendFile *bf = PAS_BACKEND_FILE (backend); char *filename; gboolean writable = FALSE; - GList *l; int db_error; DB *db; int major, minor, patch; @@ -1326,13 +1325,6 @@ pas_backend_file_load_uri (PASBackend *backend, g_free(bf->priv->uri); bf->priv->uri = g_strdup (uri); - /* report the writable status of the book to all its clients */ - for (l = bf->priv->clients; l; l = g_list_next (l)) { - PASBook *book = l->data; - - pas_book_report_writable (book, writable); - } - return TRUE; } @@ -1386,11 +1378,8 @@ pas_backend_file_add_client (PASBackend *backend, if (bf->priv->writable) pas_book_report_writable (book, bf->priv->writable); } else { - /* Open the book. */ pas_book_respond_open ( - book, GNOME_Evolution_Addressbook_BookListener_Success); - if (bf->priv->writable) - pas_book_report_writable (book, bf->priv->writable); + book, GNOME_Evolution_Addressbook_BookListener_OtherError); } bonobo_object_unref (BONOBO_OBJECT (book)); diff --git a/addressbook/backend/pas/pas-backend-ldap.c b/addressbook/backend/pas/pas-backend-ldap.c index 83e2b85971..3b0cb673af 100644 --- a/addressbook/backend/pas/pas-backend-ldap.c +++ b/addressbook/backend/pas/pas-backend-ldap.c @@ -2549,9 +2549,8 @@ pas_backend_ldap_add_client (PASBackend *backend, pas_book_respond_open ( book, GNOME_Evolution_Addressbook_BookListener_Success); } else { - /* Open the book. */ pas_book_respond_open ( - book, GNOME_Evolution_Addressbook_BookListener_Success); + book, GNOME_Evolution_Addressbook_BookListener_OtherError); } pas_book_report_writable (book, bl->priv->writable); diff --git a/addressbook/backend/pas/pas-book-factory.c b/addressbook/backend/pas/pas-book-factory.c index 6d4bcd8eb1..76e73ceca0 100644 --- a/addressbook/backend/pas/pas-book-factory.c +++ b/addressbook/backend/pas/pas-book-factory.c @@ -282,10 +282,10 @@ pas_book_factory_process_request (PASBookFactory *factory, if (!backend) goto out; - if (!pas_backend_add_client (backend, listener)) + if (!pas_backend_load_uri (backend, uri)) goto out; - pas_backend_load_uri (backend, uri); + pas_backend_add_client (backend, listener); goto out; } -- cgit v1.2.3