PIM + EDS: use direct read mode if available

Check for e_book_client_new_direct() in configure and use it if
found. This enables direct reading from the EDS file backend in the
direct searching of EDS address books.
This commit is contained in:
Patrick Ohly 2012-12-05 14:02:32 +01:00
parent 07b82c9c64
commit 3f8a9ccc02
2 changed files with 15 additions and 2 deletions

View file

@ -67,7 +67,12 @@ if test "$enable_evo" = "yes"; then
fi
# Only the EClient code supports the API in EDS 3.5.x.
PKG_CHECK_MODULES(EDS_VERSION, [libedataserver-1.2 >= 3.5],
[AC_DEFINE(USE_EDS_CLIENT, 1, [use e_book/cal_client_* calls])],
[AC_DEFINE(USE_EDS_CLIENT, 1, [use e_book/cal_client_* calls])
AC_CHECK_LIB(ebook-1.2, e_book_client_new_direct,
[AC_DEFINE(HAVE_E_BOOK_CLIENT_NEW_DIRECT, 1, [use e_book_client_new_direct])],
[true],
[$EDS_VERSION_LIBS])
],
[CFLAGS_old="$CFLAGS"
CFLAGS="$CFLAGS $EPACKAGE_CFLAGS"
AC_CHECK_HEADERS(libedataserver/eds-version.h)

View file

@ -56,7 +56,15 @@ void EDSFView::doStart()
}
m_store = EdsfPersonaStoreCXX::steal(edsf_persona_store_new_with_source_registry(m_registry, source));
GErrorCXX gerror;
m_ebook = EBookClientCXX::steal(e_book_client_new(source.get(), gerror));
m_ebook = EBookClientCXX::steal(
#ifdef HAVE_E_BOOK_CLIENT_NEW_DIRECT
getenv("SYNCEVOLUTION_NO_PIM_EDS_DIRECT") ?
e_book_client_new(source, gerror) :
e_book_client_new_direct(m_registry, source, gerror)
#else
e_book_client_new(source, gerror)
#endif
);
if (!m_ebook) {
SE_LOG_DEBUG(NULL, NULL, "edfs %s: no client for address book: %s", m_uuid.c_str(), gerror->message);
return;