diff --git a/plugins/addressbook/Makefile.am b/plugins/addressbook/Makefile.am index b6b9fe51c..9696609ba 100644 --- a/plugins/addressbook/Makefile.am +++ b/plugins/addressbook/Makefile.am @@ -1 +1 @@ -SUBDIRS=evolution +SUBDIRS=evolution test diff --git a/plugins/addressbook/test/Makefile.am b/plugins/addressbook/test/Makefile.am new file mode 100644 index 000000000..8584d973d --- /dev/null +++ b/plugins/addressbook/test/Makefile.am @@ -0,0 +1,4 @@ +check_PROGRAMS = test_addressbook + +test_addressbook_CFLAGS=@GTK_CFLAGS@ -I$(top_builddir)/addressbook/evolution/ +test_addressbook_LDADD=@GTK_LIBS@ $(top_builddir)/addressbook/evolution/libevladdrbook.so diff --git a/plugins/addressbook/test/test_addressbook.c b/plugins/addressbook/test/test_addressbook.c new file mode 100644 index 000000000..73e4088b8 --- /dev/null +++ b/plugins/addressbook/test/test_addressbook.c @@ -0,0 +1,51 @@ + +#include +#include "addressbook.h" + +/** + * Callback called after all book have been processed + */ + +static void +add_contact(const gchar *name, const char *phone, GdkPixbuf *photo) +{ +} + +static void +handler_async_search(GList *hits, gpointer user_data) +{ + AddressBook_Config *addressbook_config = user_data; + + for (GList *i = hits; i != NULL; i = i->next) { + GdkPixbuf *photo = NULL; + Hit *entry = i->data; + + if (!entry) + continue; + + add_contact(entry->name, entry->phone_home, photo); + + g_free(entry->name); + g_free(entry->phone_home); + g_free(entry); + } + + g_list_free(hits); +} + +int +main(int argc, char *argv[]) +{ + gtk_init(&argc, &argv); + + GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + + g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL); + + gtk_widget_show(window); + addressbook_init(); + + gtk_main(); + + return 0; +} diff --git a/plugins/configure.ac b/plugins/configure.ac index 46473fbdf..2967c5a18 100644 --- a/plugins/configure.ac +++ b/plugins/configure.ac @@ -48,6 +48,7 @@ AC_CONFIG_FILES([ Makefile addressbook/evolution/Makefile addressbook/Makefile +addressbook/test/Makefile ]) AC_OUTPUT