From 1d4c16a76ac2886fc626b7f64ff1f6f284cc9c9f Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Sat, 14 Apr 2001 20:26:40 +0000 Subject: Added the function e_book_view_listener_stop to tell the book view 2001-04-14 Christopher James Lahey * backend/ebook/e-book-view-listener.c, backend/ebook/e-book-view-listener.h: Added the function e_book_view_listener_stop to tell the book view listener to stop sending signals. * backend/ebook/e-book-view.c (e_book_view_destroy): Tell the EBookViewListener to stop when we're destroyed. * backend/pas/pas-backend-file.c (view_destroy, pas_backend_file_process_get_book_view, pas_backend_file_process_get_changes): Cleaned these up a bit using bonobo_object_ref and bonobo_object_unref. (pas_backend_file_process_get_book_view, pas_backend_file_process_get_changes): bonobo_object_release_unref the EBookListener here. * backend/pas/pas-backend-ldap.c (pas_backend_ldap_process_get_book_view): Cleaned this up a bit using bonobo_object_ref. Make sure to unref the listener when we're done with it. Put the new book_view in the list before telling the book_listener that it's ready. * backend/pas/pas-book-view.c (pas_book_view_construct): Cleaned this up a bit using bonobo_object_dup_ref. (pas_book_view_destroy): Cleaned this up a bit using bonobo_object_release_unref. * backend/pas/pas-book.c (pas_book_queue_get_book_view, pas_book_queue_get_changes): bonobo_object_dup_ref here instead of just duplicating. svn path=/trunk/; revision=9313 --- addressbook/backend/pas/pas-backend-ldap.c | 36 +++++++++++++----------------- 1 file changed, 16 insertions(+), 20 deletions(-) (limited to 'addressbook/backend/pas/pas-backend-ldap.c') diff --git a/addressbook/backend/pas/pas-backend-ldap.c b/addressbook/backend/pas/pas-backend-ldap.c index cc5a36f7db..c8cd900f87 100644 --- a/addressbook/backend/pas/pas-backend-ldap.c +++ b/addressbook/backend/pas/pas-backend-ldap.c @@ -1975,36 +1975,17 @@ pas_backend_ldap_process_get_book_view (PASBackend *backend, { PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend); CORBA_Environment ev; - GNOME_Evolution_Addressbook_Book corba_book; PASBookView *book_view; PASBackendLDAPBookView *view; g_return_if_fail (req->listener != NULL); - corba_book = bonobo_object_corba_objref(BONOBO_OBJECT(book)); - - CORBA_exception_init(&ev); - - GNOME_Evolution_Addressbook_Book_ref(corba_book, &ev); - - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning("pas_backend_file_process_get_book_view: Exception reffing " - "corba book.\n"); - } - - CORBA_exception_free(&ev); - book_view = pas_book_view_new (req->listener); + bonobo_object_ref(BONOBO_OBJECT(book)); gtk_signal_connect(GTK_OBJECT(book_view), "destroy", GTK_SIGNAL_FUNC(view_destroy), book); - pas_book_respond_get_book_view (book, - (book_view != NULL - ? GNOME_Evolution_Addressbook_BookListener_Success - : GNOME_Evolution_Addressbook_BookListener_CardNotFound /* XXX */), - book_view); - view = g_new0(PASBackendLDAPBookView, 1); view->book_view = book_view; view->search = g_strdup(req->search); @@ -2012,8 +1993,23 @@ pas_backend_ldap_process_get_book_view (PASBackend *backend, bl->priv->book_views = g_list_prepend(bl->priv->book_views, view); + pas_book_respond_get_book_view (book, + (book_view != NULL + ? GNOME_Evolution_Addressbook_BookListener_Success + : GNOME_Evolution_Addressbook_BookListener_CardNotFound /* XXX */), + book_view); + pas_backend_ldap_search (bl, book, view); + g_free (req->search); + CORBA_exception_init(&ev); + bonobo_object_release_unref(req->listener, &ev); + if (ev._major != CORBA_NO_EXCEPTION) { + g_warning("pas_backend_file_process_get_book_view: Exception reffing " + "corba book.\n"); + } + CORBA_exception_free(&ev); + } static void -- cgit v1.2.3