diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-03-26 14:10:42 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-03-26 14:10:42 +0800 |
commit | c66daf5a80ddfcf2bc6c3b9e98823c0b2b0eadae (patch) | |
tree | a39a085be00549a6986700999006f67f1a3c6453 /addressbook/backend/ebook/test-card.c | |
parent | eb75c1615c50dca8e06a0ba6ed46b5662c0ff0aa (diff) | |
download | gsoc2013-evolution-c66daf5a80ddfcf2bc6c3b9e98823c0b2b0eadae.tar gsoc2013-evolution-c66daf5a80ddfcf2bc6c3b9e98823c0b2b0eadae.tar.gz gsoc2013-evolution-c66daf5a80ddfcf2bc6c3b9e98823c0b2b0eadae.tar.bz2 gsoc2013-evolution-c66daf5a80ddfcf2bc6c3b9e98823c0b2b0eadae.tar.lz gsoc2013-evolution-c66daf5a80ddfcf2bc6c3b9e98823c0b2b0eadae.tar.xz gsoc2013-evolution-c66daf5a80ddfcf2bc6c3b9e98823c0b2b0eadae.tar.zst gsoc2013-evolution-c66daf5a80ddfcf2bc6c3b9e98823c0b2b0eadae.zip |
Removed the address->description field.
2000-03-26 Christopher James Lahey <clahey@helixcode.com>
* addressbook/backend/ebook/e-card-types.h: Removed the
address->description field.
* addressbook/backend/ebook/e-card.c: Added VCard output and
the use of GtkArguments.
* addressbook/backend/ebook/test-card.c: Updated this to use the
GtkArguments.
* addressbook/backend/ebook/e-book.c: Fixed a memory leak.
svn path=/trunk/; revision=2164
Diffstat (limited to 'addressbook/backend/ebook/test-card.c')
-rw-r--r-- | addressbook/backend/ebook/test-card.c | 62 |
1 files changed, 39 insertions, 23 deletions
diff --git a/addressbook/backend/ebook/test-card.c b/addressbook/backend/ebook/test-card.c index cf068a5498..1da02bad18 100644 --- a/addressbook/backend/ebook/test-card.c +++ b/addressbook/backend/ebook/test-card.c @@ -20,6 +20,8 @@ " \ "ADR;WORK;POSTAL:P.O. Box 101;;;Any Town;CA;91921-1234; " \ +"ADR;HOME;POSTAL;INTL:P.O. Box 202;;;Any Town 2;MI;12344-4321;USA +" \ "END:VCARD " \ " @@ -56,6 +58,14 @@ main (int argc, char **argv) char *cardstr; ECard *card; + /* Fields */ + char *fname; + ECardName *name; + GList *address; + GList *phone; + GList *email; + ECardDate *bday; + gnome_init ("TestCard", "0.0", argc, argv); cardstr = NULL; @@ -75,39 +85,46 @@ main (int argc, char **argv) } #endif card = e_card_new (cardstr); - if ( card->fname ) - printf("Name : %s\n", card->fname); - if ( card->name ) { + gtk_object_get(card, + "full_name", &fname, + "name", &name, + "address", &address, + "phone", &phone, + "email", &email, + "birth_date", &bday, + NULL); + if ( fname ) { + printf("Name : %s\n", fname); + g_free(fname); + } + if ( name ) { printf("Full Name:\n"); - if ( card->name->prefix ) - printf(" prefix : %s\n", card->name->prefix); - if ( card->name->given ) - printf(" given : %s\n", card->name->given); - if ( card->name->additional ) - printf(" additional : %s\n", card->name->additional); - if ( card->name->family ) - printf(" family : %s\n", card->name->family); - if ( card->name->suffix ) - printf(" suffix : %s\n", card->name->suffix); + if ( name->prefix ) + printf(" prefix : %s\n", name->prefix); + if ( name->given ) + printf(" given : %s\n", name->given); + if ( name->additional ) + printf(" additional : %s\n", name->additional); + if ( name->family ) + printf(" family : %s\n", name->family); + if ( name->suffix ) + printf(" suffix : %s\n", name->suffix); } - if ( card->bday ) { - printf("BDay : %4d-%02d-%02d\n", card->bday->year, card->bday->month, card->bday->day); + if ( bday ) { + printf("BDay : %4d-%02d-%02d\n", bday->year, bday->month, bday->day); } - if ( card->email ) { - GList *email = card->email; + if ( email ) { for ( ; email; email = email->next ) { printf("Email : %s\n", (char *) email->data); } } - if ( card->phone ) { - GList *phone = card->phone; + if ( phone ) { for ( ; phone; phone = phone->next ) { ECardPhone *e_card_phone = (ECardPhone *) phone->data; printf("Phone ; %d : %s\n", e_card_phone->flags, e_card_phone->number); } } - if ( card->address ) { - GList *address = card->address; + if ( address ) { for ( ; address; address = address->next ) { ECardDeliveryAddress *del_address = (ECardDeliveryAddress *) address->data; printf("Address ; %d:\n", del_address->flags); @@ -125,10 +142,9 @@ main (int argc, char **argv) printf(" Code : %s\n", del_address->code); if ( del_address->country ) printf(" Country : %s\n", del_address->country); - if ( del_address->description ) - printf(" Description : %s\n", del_address->description); } } + printf("%s", e_card_get_vcard(card)); gtk_object_unref (GTK_OBJECT (card)); return 0; |