aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/ebook/test-client.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-08-14 10:17:04 +0800
committerChris Lahey <clahey@src.gnome.org>2001-08-14 10:17:04 +0800
commit476458f355b639cb725188d9d8e767affa71f4ab (patch)
tree8d6686abbf6334ad7b65aa8ea15895d58e88b6bd /addressbook/backend/ebook/test-client.c
parent3157a507b2074766bbd88300cec543a28418d443 (diff)
downloadgsoc2013-evolution-476458f355b639cb725188d9d8e767affa71f4ab.tar
gsoc2013-evolution-476458f355b639cb725188d9d8e767affa71f4ab.tar.gz
gsoc2013-evolution-476458f355b639cb725188d9d8e767affa71f4ab.tar.bz2
gsoc2013-evolution-476458f355b639cb725188d9d8e767affa71f4ab.tar.lz
gsoc2013-evolution-476458f355b639cb725188d9d8e767affa71f4ab.tar.xz
gsoc2013-evolution-476458f355b639cb725188d9d8e767affa71f4ab.tar.zst
gsoc2013-evolution-476458f355b639cb725188d9d8e767affa71f4ab.zip
Changed get_card to be asyncronous.
2001-08-13 Christopher James Lahey <clahey@ximian.com> * backend/ebook/e-book-listener.c, backend/ebook/e-book-listener.h, backend/ebook/e-book.c, backend/ebook/e-book.h, backend/idl/addressbook.idl, backend/pas/pas-backend-file.c, backend/pas/pas-book.c, backend/pas/pas-book.h: Changed get_card to be asyncronous. * backend/ebook/e-card.c, backend/ebook/test-client.c: Changed these to deal with the new get_card functionality. svn path=/trunk/; revision=11984
Diffstat (limited to 'addressbook/backend/ebook/test-client.c')
-rw-r--r--addressbook/backend/ebook/test-client.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/addressbook/backend/ebook/test-client.c b/addressbook/backend/ebook/test-client.c
index 6ffa099ab3..cc7572c24c 100644
--- a/addressbook/backend/ebook/test-client.c
+++ b/addressbook/backend/ebook/test-client.c
@@ -66,10 +66,23 @@ get_cursor_cb (EBook *book, EBookStatus status, ECardCursor *cursor, gpointer cl
}
static void
-add_card_cb (EBook *book, EBookStatus status, const gchar *id, gpointer closure)
+get_card_cb (EBook *book, EBookStatus status, ECard *card, gpointer closure)
{
char *vcard;
- ECard *card;
+
+ vcard = e_card_get_vcard(card);
+ printf ("Card added: [%s]\n", vcard);
+ g_free(vcard);
+ gtk_object_unref(GTK_OBJECT(card));
+
+ printf ("Getting cards..\n");
+ e_book_get_cursor(book, "", get_cursor_cb, NULL);
+ printf ("Done getting all cards.\n");
+}
+
+static void
+add_card_cb (EBook *book, EBookStatus status, const gchar *id, gpointer closure)
+{
GTimer *timer;
printf ("Status: %d\n", status);
@@ -78,18 +91,9 @@ add_card_cb (EBook *book, EBookStatus status, const gchar *id, gpointer closure)
timer = g_timer_new ();
g_timer_start (timer);
- card = e_book_get_card (book, id);
+ e_book_get_card (book, id, get_card_cb, closure);
g_timer_stop (timer);
-
- vcard = e_card_get_vcard(card);
printf ("%g\n", g_timer_elapsed (timer, NULL));
- printf ("Card added: [%s]\n", vcard);
- g_free(vcard);
- gtk_object_unref(GTK_OBJECT(card));
-
- printf ("Getting cards..\n");
- e_book_get_cursor(book, "", get_cursor_cb, NULL);
- printf ("Done getting all cards.\n");
}
static void