[Evolution-hackers] e-book api change heads up



I know I said it was unlikely that we'd need to make changes to the
libebook api, but it turns out there's at least one bug (55776) that is
made impossible to fix by the current api (and removing addressbook when
you make a mistake while entering them seems like it would be a good
feature to have...)

The old way of doing things looked (in the synchronous case) like:

EBook *book = e_book_new ();
e_book_load_source (book, source, TRUE, &gerror);

this has the failing that there's no way to associate a source with a
book before you load it, and loading is an operation that can fail.
That, couple with the fact that there's an operation that might need to
be performed on books that can't be loaded (e_book_remove, as in bug
55776), requires we change to the way libecal already does things.  So
we have:

EBook *book = e_book_new (source, &gerror);
e_book_open (book, TRUE, &gerror);

All the old e_book_load_* calls have been replaced with equivalent
e_book_new_* calls.  Additionally, e_book_get_default_addressbook has
been replaced with e_book_new_default_addressbook to make things more
consistent.  I'll be submitting a calendar patch to make the analogous
change there tonight or tomorrow.

This change also means that you're going to need to start checking the
return value of e_book_new.  We actually activate the corba factories
and call BookFactory::getBook from e_book_new now, so there's a chance
it'll fail and return NULL.

The async api has been similarly changed.  There are no more
e_book_async_load_* functions, all of them have been replaced with the
equivalent e_book_new_* functions + e_book_async_open.

I just committed the changes (and all the porting required for
evolution) to CVS a little while ago.  Please let me know if you have
any problems.

Cheers,
Chris



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]