diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-03-28 11:52:46 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-03-28 11:52:46 +0800 |
commit | 21e60e238477edd1ad157bd17024d5ea6395e048 (patch) | |
tree | 4f251e318f085aecc387c49f052a14f7874c1a1a /addressbook/backend/ebook/test-client.c | |
parent | bd46ea2926e3f244d6d875195363d261f53a4e07 (diff) | |
download | gsoc2013-evolution-21e60e238477edd1ad157bd17024d5ea6395e048.tar gsoc2013-evolution-21e60e238477edd1ad157bd17024d5ea6395e048.tar.gz gsoc2013-evolution-21e60e238477edd1ad157bd17024d5ea6395e048.tar.bz2 gsoc2013-evolution-21e60e238477edd1ad157bd17024d5ea6395e048.tar.lz gsoc2013-evolution-21e60e238477edd1ad157bd17024d5ea6395e048.tar.xz gsoc2013-evolution-21e60e238477edd1ad157bd17024d5ea6395e048.tar.zst gsoc2013-evolution-21e60e238477edd1ad157bd17024d5ea6395e048.zip |
Fixed some warnings.
2000-03-27 Christopher James Lahey <clahey@helixcode.com>
* addressbook/backend/ebook/test-card.c: Fixed some warnings.
* addressbook/backend/ebook/test-client.c: Added a section to test
cursors and returning an id when adding.
* addressbook/backend/ebook/e-card-pairs.h: Removed the address
pairs since they were added to e-card.c.
* addressbook/backend/ebook/e-card.c,
addressbook/backend/ebook/e-card.h: Made the set_id function take
a const char *.
* addressbook/backend/ebook/e-book-listener.c,
addressbook/backend/ebook/e-book-listener.h,
addressbook/backend/ebook/e-book.c,
addressbook/backend/ebook/e-book.h,
addressbook/backend/idl/addressbook.idl,
addressbook/backend/pas/pas-backend-file.c,
addressbook/backend/pas/pas-book.c,
addressbook/backend/pas/pas-book.h: Added a get_all_cards function
and made the response to the create_card function include the card
id.
* addressbook/backend/ebook/Makefile.am: Added e-card-cursor.c and
e-card-cursor.h.
* addressbook/backend/ebook/e-card-cursor.c,
addressbook/backend/ebook/e-card-cursor.h: New class for proxying
to an Evolution_CardCursor.
* addressbook/backend/pas/Makefile.am: Added pas-card-cursor.c and
pas-card-cursor.h.
* addressbook/backend/pas/pas-card-cursor.c,
addressbook/backend/pas/pas-card-cursor.h: New bonobo class for
making an Evolution_CardCursor server.
svn path=/trunk/; revision=2205
Diffstat (limited to 'addressbook/backend/ebook/test-client.c')
-rw-r--r-- | addressbook/backend/ebook/test-client.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/addressbook/backend/ebook/test-client.c b/addressbook/backend/ebook/test-client.c index 365019f7bd..945df3f53c 100644 --- a/addressbook/backend/ebook/test-client.c +++ b/addressbook/backend/ebook/test-client.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ #include <config.h> #include <bonobo.h> #include <gnome.h> @@ -47,8 +48,26 @@ init_bonobo (int argc, char **argv) } +#if 0 static void -add_card_cb (EBook *book, EBookStatus status, gpointer closure) +get_cursor_cb (EBook *book, EBookStatus status, ECardCursor *cursor, gpointer closure) +{ + long length = e_card_cursor_get_length(cursor); + long i; + + for ( i = 0; i < length; i++ ) { + ECard *card = e_card_cursor_get_nth(cursor, i); + char *vcard = e_card_get_vcard(card); + printf("[%s]\n", vcard); + g_free(vcard); + gtk_object_unref(GTK_OBJECT(card)); + } + gtk_object_unref(GTK_OBJECT(cursor)); +} +#endif + +static void +add_card_cb (EBook *book, EBookStatus status, const gchar *id, gpointer closure) { char *vcard; ECard *card; @@ -56,9 +75,11 @@ add_card_cb (EBook *book, EBookStatus status, gpointer closure) printf ("Status: %d\n", status); + printf ("Id: %s\n", id); + timer = g_timer_new (); g_timer_start (timer); - card = e_book_get_card (book, "foo"); + card = e_book_get_card (book, id); g_timer_stop (timer); vcard = e_card_get_vcard(card); @@ -66,12 +87,16 @@ add_card_cb (EBook *book, EBookStatus status, gpointer closure) printf ("[%s]\n", vcard); g_free(vcard); gtk_object_unref(GTK_OBJECT(card)); + +#if 0 + e_book_get_all_cards(book, get_cursor_cb, NULL); +#endif } static void book_open_cb (EBook *book, EBookStatus status, gpointer closure) { - e_book_add_vcard(book, TEST_VCARD, add_card_cb, NULL); + e_book_add_vcard(book, TEST_VCARD, add_card_cb, NULL); } static guint |