diff options
author | Christopher James Lahey <clahey@ximian.com> | 2001-08-01 15:13:05 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-08-01 15:13:05 +0800 |
commit | e567bc692a7d6da7cb793fcb1cbd47ef64ae3455 (patch) | |
tree | 257ce7217a0e25100f28d2ed8fd2e49fe8125544 /addressbook/backend/ebook/e-book.c | |
parent | 0ff44374fd277fe0663550bf7dc8348680bd5731 (diff) | |
download | gsoc2013-evolution-e567bc692a7d6da7cb793fcb1cbd47ef64ae3455.tar.gz gsoc2013-evolution-e567bc692a7d6da7cb793fcb1cbd47ef64ae3455.tar.zst gsoc2013-evolution-e567bc692a7d6da7cb793fcb1cbd47ef64ae3455.zip |
Removed thrash checking code here since thrashing shouldn't happen now
2001-08-01 Christopher James Lahey <clahey@ximian.com>
* backend/ebook/e-book-view-listener.c
(e_book_view_listener_check_queue): Removed thrash checking code
here since thrashing shouldn't happen now that we've cleaned this
up some.
* backend/ebook/e-book.c (e_book_do_response_get_view): Properly
handle cases where construction fails.
svn path=/trunk/; revision=11539
Diffstat (limited to 'addressbook/backend/ebook/e-book.c')
-rw-r--r-- | addressbook/backend/ebook/e-book.c | 132 |
1 files changed, 74 insertions, 58 deletions
diff --git a/addressbook/backend/ebook/e-book.c b/addressbook/backend/ebook/e-book.c index 73b39b6c46..9c8111b714 100644 --- a/addressbook/backend/ebook/e-book.c +++ b/addressbook/backend/ebook/e-book.c @@ -206,28 +206,32 @@ e_book_do_response_get_cursor (EBook *book, cursor = e_card_cursor_new(resp->cursor); - if (op->cb) { - if (op->active) - ((EBookCursorCallback) op->cb) (book, resp->status, cursor, op->closure); - else - ((EBookCursorCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure); - } + if (cursor != NULL) { + if (op->cb) { + if (op->active) + ((EBookCursorCallback) op->cb) (book, resp->status, cursor, op->closure); + else + ((EBookCursorCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure); + } - /* - * Release the remote GNOME_Evolution_Addressbook_Book in the PAS. - */ - CORBA_exception_init (&ev); + /* + * Release the remote GNOME_Evolution_Addressbook_Book in the PAS. + */ + CORBA_exception_init (&ev); - bonobo_object_release_unref (resp->cursor, &ev); + bonobo_object_release_unref (resp->cursor, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("e_book_do_response_get_cursor: Exception releasing " - "remote GNOME_Evolution_Addressbook_CardCursor interface!\n"); - } + if (ev._major != CORBA_NO_EXCEPTION) { + g_warning ("e_book_do_response_get_cursor: Exception releasing " + "remote GNOME_Evolution_Addressbook_CardCursor interface!\n"); + } - CORBA_exception_free (&ev); + CORBA_exception_free (&ev); - gtk_object_unref(GTK_OBJECT(cursor)); + gtk_object_unref(GTK_OBJECT(cursor)); + } else { + ((EBookCursorCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure); + } g_free (op); } @@ -251,35 +255,41 @@ e_book_do_response_get_view (EBook *book, } book_view = e_book_view_new(resp->book_view, op->listener); - e_book_view_set_book (book_view, book); - /* Only execute the callback if the operation is still flagged as active (i.e. hasn't - been cancelled. This is mildly wasteful since we unnecessaryily create the - book_view, etc... but I'm leery of tinkering with the CORBA magic. */ - if (op->cb) { - if (op->active) - ((EBookBookViewCallback) op->cb) (book, resp->status, book_view, op->closure); - else - ((EBookBookViewCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure); - } + if (book_view != NULL) { + e_book_view_set_book (book_view, book); + + /* Only execute the callback if the operation is still flagged as active (i.e. hasn't + been cancelled. This is mildly wasteful since we unnecessaryily create the + book_view, etc... but I'm leery of tinkering with the CORBA magic. */ + if (op->cb) { + if (op->active) + ((EBookBookViewCallback) op->cb) (book, resp->status, book_view, op->closure); + else + ((EBookBookViewCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure); + } - /* - * Release the remote GNOME_Evolution_Addressbook_Book in the PAS. - */ - CORBA_exception_init (&ev); + /* + * Release the remote GNOME_Evolution_Addressbook_Book in the PAS. + */ + CORBA_exception_init (&ev); - bonobo_object_release_unref (resp->book_view, &ev); + bonobo_object_release_unref (resp->book_view, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("e_book_do_response_get_view: Exception releasing " - "remote GNOME_Evolution_Addressbook_BookView interface!\n"); - } + if (ev._major != CORBA_NO_EXCEPTION) { + g_warning ("e_book_do_response_get_view: Exception releasing " + "remote GNOME_Evolution_Addressbook_BookView interface!\n"); + } - CORBA_exception_free (&ev); + CORBA_exception_free (&ev); + + gtk_object_unref(GTK_OBJECT(book_view)); + } else { + e_book_view_listener_stop (op->listener); + ((EBookBookViewCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure); + } - gtk_object_unref(GTK_OBJECT(book_view)); bonobo_object_unref(BONOBO_OBJECT(op->listener)); - g_free (op); } @@ -300,32 +310,38 @@ e_book_do_response_get_changes (EBook *book, } book_view = e_book_view_new (resp->book_view, op->listener); - e_book_view_set_book (book_view, book); + + if (book_view != NULL) { + e_book_view_set_book (book_view, book); - if (op->cb) { - if (op->active) - ((EBookBookViewCallback) op->cb) (book, resp->status, book_view, op->closure); - else - ((EBookBookViewCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure); - } + if (op->cb) { + if (op->active) + ((EBookBookViewCallback) op->cb) (book, resp->status, book_view, op->closure); + else + ((EBookBookViewCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure); + } - /* - * Release the remote GNOME_Evolution_Addressbook_BookView in the PAS. - */ - CORBA_exception_init (&ev); + /* + * Release the remote GNOME_Evolution_Addressbook_BookView in the PAS. + */ + CORBA_exception_init (&ev); - bonobo_object_release_unref (resp->book_view, &ev); + bonobo_object_release_unref (resp->book_view, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("e_book_do_response_get_changes: Exception releasing " - "remote GNOME_Evolution_Addressbook_BookView interface!\n"); - } + if (ev._major != CORBA_NO_EXCEPTION) { + g_warning ("e_book_do_response_get_changes: Exception releasing " + "remote GNOME_Evolution_Addressbook_BookView interface!\n"); + } - CORBA_exception_free (&ev); + CORBA_exception_free (&ev); + + gtk_object_unref(GTK_OBJECT(book_view)); + } else { + e_book_view_listener_stop (op->listener); + ((EBookBookViewCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure); + } - gtk_object_unref(GTK_OBJECT(book_view)); bonobo_object_unref(BONOBO_OBJECT(op->listener)); - g_free (op); } |