Commit 42f38427 authored by Tristan Matthews's avatar Tristan Matthews

* #19035: addressbook: add standalone test

parent d670bbc7
SUBDIRS=evolution
SUBDIRS=evolution test
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
#include <gtk/gtk.h>
#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;
}
......@@ -48,6 +48,7 @@ AC_CONFIG_FILES([
Makefile
addressbook/evolution/Makefile
addressbook/Makefile
addressbook/test/Makefile
])
AC_OUTPUT
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