# define PRINT_TIMER(timer, activity)
#endif
-static gboolean loading_view = FALSE;
static gboolean uids_only = FALSE;
/****************************************************************
* Modify/Setup the EBook *
****************************************************************/
-static void
-add_contact (EBookClient *client)
-{
- EContact *contact = e_contact_new ();
-
- e_contact_set (contact, E_CONTACT_FULL_NAME, "Micheal Jackson");
-
- if (!add_contact_verify (client, contact))
- g_error ("Failed to add Micheal Jackson");
-
- g_object_unref (contact);
-}
-
static gboolean
setup_book (EBookClient *book_client)
{
gpointer user_data)
{
const GSList *l;
- GMainLoop *loop = (GMainLoop *) user_data;
for (l = contacts; l; l = l->next) {
EContact *contact = l->data;
else if (!uids_only && e_contact_get_const (contact, E_CONTACT_FULL_NAME) == NULL)
g_error ("expected contact name missing");
}
-
- if (!loading_view)
- finish_test (view, loop);
-
}
static void
static void
complete (EBookClientView *view,
- const GError *error)
+ const GError *error,
+ gpointer user_data)
{
- EBookClient *client;
-
- client = e_book_client_view_ref_client (view);
-
- /* Now add a contact and assert that we received notification */
- loading_view = FALSE;
- add_contact (client);
+ GMainLoop *loop = (GMainLoop *) user_data;
- g_object_unref (client);
+ finish_test (view, loop);
}
static void
if (error)
g_error ("set fields of interest: %s", error->message);
- loading_view = TRUE;
-
e_book_client_view_start (view, &error);
if (error)
g_error ("start view: %s", error->message);