diff options
author | Chris Toshok <toshok@ximian.com> | 2002-02-21 12:34:28 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2002-02-21 12:34:28 +0800 |
commit | 9193a985af25894f53f1b01ad68f87e9f5049039 (patch) | |
tree | 59175f1492f3a807a7190cd7058cc1b48939fcdb /addressbook | |
parent | 18011729aec7fdb33f94129b5240451ec7d273d0 (diff) | |
download | gsoc2013-evolution-9193a985af25894f53f1b01ad68f87e9f5049039.tar.gz gsoc2013-evolution-9193a985af25894f53f1b01ad68f87e9f5049039.tar.zst gsoc2013-evolution-9193a985af25894f53f1b01ad68f87e9f5049039.zip |
track change to signature, and (for now) just change all the return
2002-02-20 Chris Toshok <toshok@ximian.com>
* backend/pas/pas-backend-file.c (pas_backend_file_load_uri):
track change to signature, and (for now) just change all the
return FALSE's to _RepositoryOffline (what FALSE used to map to in
pas_book_factory_process_request), and change TRUE to _Success.
* backend/pas/pas-backend-ldap.c (pas_backend_ldap_load_uri):
track change to signature, and differentiate between
pas_backend_ldap_connect failing (RepositoryOffline), and
ldap_url_parse failing (OtherError).
* backend/pas/pas-book-factory.c
(pas_book_factory_process_request): since pas_backend_load_uri
returns status now, use it to nodify the BookListener if there's a
failure.
* backend/pas/pas-backend.c (pas_backend_load_uri): track change
to signature.
* backend/pas/pas-backend.h: change return type of
pas_backend_load_uri to
GNOME_Evolution_Addressbook_BookListener_CallStatus to allow
differentiation between failure types.
* backend/ebook/e-book-listener.c
(e_book_listener_convert_status): handle _AUTHENTICATION_FAILED.
* backend/ebook/e-book-types.h (EBookStatus): add
_AUTHENTICATION_FAILED.
svn path=/trunk/; revision=15779
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/ChangeLog | 31 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-book-listener.c | 2 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-book-types.h | 1 | ||||
-rw-r--r-- | addressbook/backend/pas/pas-backend-file.c | 19 | ||||
-rw-r--r-- | addressbook/backend/pas/pas-backend-ldap.c | 8 | ||||
-rw-r--r-- | addressbook/backend/pas/pas-backend.c | 2 | ||||
-rw-r--r-- | addressbook/backend/pas/pas-backend.h | 6 | ||||
-rw-r--r-- | addressbook/backend/pas/pas-book-factory.c | 7 |
8 files changed, 59 insertions, 17 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index cade85649a..e5b942029b 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,34 @@ +2002-02-20 Chris Toshok <toshok@ximian.com> + + * backend/pas/pas-backend-file.c (pas_backend_file_load_uri): + track change to signature, and (for now) just change all the + return FALSE's to _RepositoryOffline (what FALSE used to map to in + pas_book_factory_process_request), and change TRUE to _Success. + + * backend/pas/pas-backend-ldap.c (pas_backend_ldap_load_uri): + track change to signature, and differentiate between + pas_backend_ldap_connect failing (RepositoryOffline), and + ldap_url_parse failing (OtherError). + + * backend/pas/pas-book-factory.c + (pas_book_factory_process_request): since pas_backend_load_uri + returns status now, use it to nodify the BookListener if there's a + failure. + + * backend/pas/pas-backend.c (pas_backend_load_uri): track change + to signature. + + * backend/pas/pas-backend.h: change return type of + pas_backend_load_uri to + GNOME_Evolution_Addressbook_BookListener_CallStatus to allow + differentiation between failure types. + + * backend/ebook/e-book-listener.c + (e_book_listener_convert_status): handle _AUTHENTICATION_FAILED. + + * backend/ebook/e-book-types.h (EBookStatus): add + _AUTHENTICATION_FAILED. + 2002-02-18 Chris Toshok <toshok@ximian.com> * backend/pas/pas-book-factory.c diff --git a/addressbook/backend/ebook/e-book-listener.c b/addressbook/backend/ebook/e-book-listener.c index a66701847d..139eb849fa 100644 --- a/addressbook/backend/ebook/e-book-listener.c +++ b/addressbook/backend/ebook/e-book-listener.c @@ -620,6 +620,8 @@ e_book_listener_convert_status (const GNOME_Evolution_Addressbook_BookListener_C return E_BOOK_STATUS_SUCCESS; case GNOME_Evolution_Addressbook_BookListener_RepositoryOffline: return E_BOOK_STATUS_REPOSITORY_OFFLINE; + case GNOME_Evolution_Addressbook_BookListener_AuthenticationFailed: + return E_BOOK_STATUS_AUTHENTICATION_FAILED; case GNOME_Evolution_Addressbook_BookListener_PermissionDenied: return E_BOOK_STATUS_PERMISSION_DENIED; case GNOME_Evolution_Addressbook_BookListener_CardNotFound: diff --git a/addressbook/backend/ebook/e-book-types.h b/addressbook/backend/ebook/e-book-types.h index 0a477678eb..9ce3323bdf 100644 --- a/addressbook/backend/ebook/e-book-types.h +++ b/addressbook/backend/ebook/e-book-types.h @@ -25,6 +25,7 @@ typedef enum { E_BOOK_STATUS_CARD_ID_ALREADY_EXISTS, E_BOOK_STATUS_PROTOCOL_NOT_SUPPORTED, E_BOOK_STATUS_CANCELLED, + E_BOOK_STATUS_AUTHENTICATION_FAILED, E_BOOK_STATUS_OTHER_ERROR } EBookStatus; diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c index 57f9462bb8..7d6499578d 100644 --- a/addressbook/backend/pas/pas-backend-file.c +++ b/addressbook/backend/pas/pas-backend-file.c @@ -58,6 +58,7 @@ struct _PASBackendFilePrivate { DB *file_db; EList *book_views; gboolean writable; + GHashTable *address_lists; }; struct _PASBackendFileCursorPrivate { @@ -702,10 +703,12 @@ pas_backend_file_process_modify_card (PASBackend *backend, pas_book_view_notify_add_1 (view->book_view, req->vcard); else /* if (old_match) */ pas_book_view_notify_remove (view->book_view, id); + pas_book_view_notify_complete (view->book_view); bonobo_object_release_unref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), &ev); } + gtk_object_unref(GTK_OBJECT(iterator)); pas_book_respond_modify ( @@ -1236,7 +1239,7 @@ ORG:Ximian, Inc.;\n\ NOTE:Welcome to the Ximian Addressbook.\n\ END:VCARD" -static gboolean +static GNOME_Evolution_Addressbook_BookListener_CallStatus pas_backend_file_load_uri (PASBackend *backend, const char *uri) { @@ -1255,18 +1258,18 @@ pas_backend_file_load_uri (PASBackend *backend, minor != 1 || patch != 17) { g_warning ("Wrong version of libdb."); - return FALSE; + return GNOME_Evolution_Addressbook_BookListener_OtherError; } filename = pas_backend_file_extract_path_from_uri (uri); db_error = e_db3_utils_maybe_recover (filename); if (db_error != 0) - return FALSE; + return GNOME_Evolution_Addressbook_BookListener_OtherError; db_error = db_create (&db, NULL, 0); if (db_error != 0) - return FALSE; + return GNOME_Evolution_Addressbook_BookListener_OtherError; db_error = db->open (db, filename, NULL, DB_HASH, 0, 0666); @@ -1274,7 +1277,7 @@ pas_backend_file_load_uri (PASBackend *backend, db_error = e_db3_utils_upgrade_format (filename); if (db_error != 0) - return FALSE; + return GNOME_Evolution_Addressbook_BookListener_OtherError; db_error = db->open (db, filename, NULL, DB_HASH, 0, 0666); } @@ -1312,7 +1315,7 @@ pas_backend_file_load_uri (PASBackend *backend, if (db_error != 0) { bf->priv->file_db = NULL; - return FALSE; + return GNOME_Evolution_Addressbook_BookListener_OtherError; } bf->priv->writable = writable; @@ -1323,7 +1326,7 @@ pas_backend_file_load_uri (PASBackend *backend, db->close (db, 0); bf->priv->file_db = NULL; bf->priv->writable = FALSE; - return FALSE; + return GNOME_Evolution_Addressbook_BookListener_OtherError; } g_free(bf->priv->uri); @@ -1332,7 +1335,7 @@ pas_backend_file_load_uri (PASBackend *backend, g_free (bf->priv->filename); bf->priv->filename = filename; - return TRUE; + return GNOME_Evolution_Addressbook_BookListener_Success; } /* Get_uri handler for the addressbook file backend */ diff --git a/addressbook/backend/pas/pas-backend-ldap.c b/addressbook/backend/pas/pas-backend-ldap.c index 3071fa7e45..60f2103c79 100644 --- a/addressbook/backend/pas/pas-backend-ldap.c +++ b/addressbook/backend/pas/pas-backend-ldap.c @@ -2553,7 +2553,7 @@ pas_backend_ldap_book_destroy_cb (PASBook *book, gpointer data) pas_backend_remove_client (PAS_BACKEND (backend), book); } -static gboolean +static GNOME_Evolution_Addressbook_BookListener_CallStatus pas_backend_ldap_load_uri (PASBackend *backend, const char *uri) { @@ -2609,11 +2609,11 @@ pas_backend_ldap_load_uri (PASBackend *backend, pas_backend_ldap_connect (bl); if (bl->priv->ldap == NULL) - return FALSE; + return GNOME_Evolution_Addressbook_BookListener_RepositoryOffline; else - return TRUE; + return GNOME_Evolution_Addressbook_BookListener_Success; } else - return FALSE; + return GNOME_Evolution_Addressbook_BookListener_OtherError; } /* Get_uri handler for the addressbook LDAP backend */ diff --git a/addressbook/backend/pas/pas-backend.c b/addressbook/backend/pas/pas-backend.c index 593ed624d2..a17e014002 100644 --- a/addressbook/backend/pas/pas-backend.c +++ b/addressbook/backend/pas/pas-backend.c @@ -28,7 +28,7 @@ pas_backend_construct (PASBackend *backend) return TRUE; } -gboolean +GNOME_Evolution_Addressbook_BookListener_CallStatus pas_backend_load_uri (PASBackend *backend, const char *uri) { diff --git a/addressbook/backend/pas/pas-backend.h b/addressbook/backend/pas/pas-backend.h index bd9a12c2a0..cdf8f37c30 100644 --- a/addressbook/backend/pas/pas-backend.h +++ b/addressbook/backend/pas/pas-backend.h @@ -40,7 +40,7 @@ typedef struct { GtkObjectClass parent_class; /* Virtual methods */ - gboolean (*load_uri) (PASBackend *backend, const char *uri); + GNOME_Evolution_Addressbook_BookListener_CallStatus (*load_uri) (PASBackend *backend, const char *uri); const char *(* get_uri) (PASBackend *backend); gboolean (*add_client) (PASBackend *backend, GNOME_Evolution_Addressbook_BookListener listener); void (*remove_client) (PASBackend *backend, PASBook *book); @@ -53,7 +53,9 @@ typedef struct { typedef PASBackend * (*PASBackendFactoryFn) (void); gboolean pas_backend_construct (PASBackend *backend); -gboolean pas_backend_load_uri (PASBackend *backend, + +GNOME_Evolution_Addressbook_BookListener_CallStatus + pas_backend_load_uri (PASBackend *backend, const char *uri); const char *pas_backend_get_uri (PASBackend *backend); diff --git a/addressbook/backend/pas/pas-book-factory.c b/addressbook/backend/pas/pas-book-factory.c index 43bb69a35c..9c713f5ce8 100644 --- a/addressbook/backend/pas/pas-book-factory.c +++ b/addressbook/backend/pas/pas-book-factory.c @@ -278,16 +278,19 @@ pas_book_factory_process_request (PASBookFactory *factory, backend = g_hash_table_lookup (factory->priv->active_server_map, uri); if (!backend) { + GNOME_Evolution_Addressbook_BookListener_CallStatus status; + backend = pas_book_factory_launch_backend (factory, listener, uri); if (!backend) goto out; - if (!pas_backend_load_uri (backend, uri) ) { + status = pas_backend_load_uri (backend, uri); + if (status != GNOME_Evolution_Addressbook_BookListener_Success) { /* tell the listener that we failed to open the book */ CORBA_exception_init (&ev); GNOME_Evolution_Addressbook_BookListener_notifyBookOpened ( - listener, GNOME_Evolution_Addressbook_BookListener_RepositoryOffline, + listener, status, CORBA_OBJECT_NIL, &ev); |