Commit 61f7f03e authored by Alexandre Savard's avatar Alexandre Savard

#5883: Fix compilation issues on maverick and lucid

parent c8353c8c
......@@ -56,7 +56,7 @@ PKG_CHECK_MODULES(SFLGTK, gtk+-2.0 > 2.2)
PKG_CHECK_MODULES(SFLGLIB, glib-2.0 >= 2.2)
PKG_CHECK_MODULES(WEBKIT, webkit-1.0)
PKG_CHECK_MODULES(LIBEBOOK, libebook-1.2 >= 1.4)
PKG_CHECK_MODULES(LIBEDATASERVER, libedataserver-1.2)
PKG_CHECK_MODULES([LIBEDATASERVER], [libedataserver-1.2 >= 2.32], [AC_DEFINE([LIBEDATASERVER_VERSION_2_32], [], [Using libedataserver-1.2 version 2.32 or higher])],[PKG_CHECK_MODULES([LIBEDATASERVER], [libedataserver-1.2 >= 1.4])])
#PKG_CHECK_MODULES(LIBEDATASERVERUI, libedataserverui-1.2)
PKG_CHECK_MODULES(LIBGNOMEUI, libgnomeui-2.0)
PKG_CHECK_MODULES(GNOMEDOCUTILS, gnome-doc-utils)
......
......@@ -44,8 +44,9 @@
#include <addressbook-config.h>
#include <libedataserver/e-source.h>
// #define LIBEBOOK_VERSION_230
#include "config.h"
// #define LIBEBOOK_VERSION_230
/**
* Structure used to store search callback and data
*/
......@@ -310,18 +311,7 @@ view_finish_callback (EBookView *book_view, Search_Handler_And_Data *had)
/**
* Callback called after a contact have been found in EDS by search_async_by_contacts.
*/
#ifdef LIBEBOOK_VERSION_230
static void
eds_query_result_cb (EBook *book, EBookStatus status, GList *contacts, gpointer user_data)
{
DEBUG ("Addressbook: Search Result callback called");
if (status != E_BOOK_ERROR_OK) {
ERROR ("Addressbook: Error: ");
return;
}
#else
#ifdef LIBEDATASERVER_VERSION_2_32
void
eds_query_result_cb (EBook *book, const GError *error, GList *contacts, gpointer user_data)
{
......@@ -331,6 +321,16 @@ eds_query_result_cb (EBook *book, const GError *error, GList *contacts, gpointer
ERROR ("Addressbook: Error: %s", error->message);
return;
}
#else
static void
eds_query_result_cb (EBook *book, EBookStatus status, GList *contacts, gpointer user_data)
{
DEBUG ("Addressbook: Search Result callback called");
if (status != E_BOOK_ERROR_OK) {
ERROR ("Addressbook: Error: ");
return;
}
#endif
Search_Handler_And_Data *had = (Search_Handler_And_Data *) user_data;
......@@ -389,28 +389,28 @@ eds_query_result_cb (EBook *book, const GError *error, GList *contacts, gpointer
/**
* Callback for asynchronous open of books
*/
#ifdef LIBEBOOK_VERSION_230
static void
eds_async_open_callback (EBook *book, EBookStatus status, gpointer closure)
#ifdef LIBEDATASERVER_VERSION_2_32
void
eds_async_open_callback (EBook *book, const GError *error, gpointer closure)
{
DEBUG("Addressbook: Open book callback");
ESource *source;
const gchar *uri;
if(status == E_BOOK_ERROR_OK) {
ERROR("Addressbook: Error: ");
if(error) {
ERROR("Addressbook: Error: %s", error->message);
return;
}
#else
void
eds_async_open_callback (EBook *book, const GError *error, gpointer closure)
static void
eds_async_open_callback (EBook *book, EBookStatus status, gpointer closure)
{
DEBUG("Addressbook: Open book callback");
ESource *source;
const gchar *uri;
if(error) {
ERROR("Addressbook: Error: %s", error->message);
if(status == E_BOOK_ERROR_OK) {
ERROR("Addressbook: Error: ");
return;
}
......@@ -433,13 +433,12 @@ eds_async_open_callback (EBook *book, const GError *error, gpointer closure)
e_book_open (book, FALSE, NULL);
}
#ifdef LIBEBOOK_VERSION_230
#ifdef LIBEDATASERVER_VERSION_2_32
if (!e_book_get_contacts_async (book, had->equery, eds_query_result_cb, had))
ERROR("Addressbook: Error: While querying addressbook");
#else
if (e_book_async_get_contacts (book, had->equery, eds_query_result_cb, had))
ERROR ("Addressbook: Error: While querying addressbook");
#else
if (!e_book_get_contacts_async (book, had->equery, eds_query_result_cb, had)) {
ERROR("Addressbook: Error: While querying addressbook");
}
#endif
}
......@@ -740,12 +739,11 @@ search_async_by_contacts (const char *query, int max_results, SearchAsyncHandler
if (book) {
DEBUG ("Addressbook: Created empty book successfully");
#ifdef LIBEBOOK_VERSION_230
// Asynchronous open
e_book_async_open(book, TRUE,
eds_async_open_callback, had);
#else
#ifdef LIBEDATASERVER_VERSION_2_32
e_book_open_async (book, TRUE, eds_async_open_callback, had);
#else
// Asynchronous open
e_book_async_open(book, TRUE, eds_async_open_callback, had);
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment