From d87e7fd2c87f502414ed1aaacba85a1de3287917 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Tue, 30 Mar 2004 22:19:22 +0000 Subject: [ part of the fix for #54528, the other part is in e-d-s ] 2004-03-30 Chris Toshok [ part of the fix for #54528, the other part is in e-d-s ] * importers/evolution-vcard-importer.c (process_item_fn): get and set the PHOTO attribute before storing the contact in the book. this has the affect of making EContact sniff the image format. the apple addressbook doesn't give PHOTO's a TYPE. svn path=/trunk/; revision=25250 --- addressbook/ChangeLog | 10 ++++++++++ addressbook/importers/evolution-vcard-importer.c | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index de667447a5..ecc67cc7dd 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,13 @@ +2004-03-30 Chris Toshok + + [ part of the fix for #54528, the other part is in e-d-s ] + + * importers/evolution-vcard-importer.c (process_item_fn): get and + set the PHOTO attribute before storing the contact in the book. + this has the affect of making EContact sniff the image format. + the apple addressbook doesn't give PHOTO's a TYPE. + + 2004-03-30 Chris Toshok [ fixes bug #53094 ] diff --git a/addressbook/importers/evolution-vcard-importer.c b/addressbook/importers/evolution-vcard-importer.c index f6fab08983..83bec58892 100644 --- a/addressbook/importers/evolution-vcard-importer.c +++ b/addressbook/importers/evolution-vcard-importer.c @@ -69,6 +69,7 @@ process_item_fn (EvolutionImporter *importer, { VCardImporter *gci = (VCardImporter *) closure; EContact *contact; + EContactPhoto *photo; if (gci->iterator == NULL) gci->iterator = gci->contactlist; @@ -89,6 +90,21 @@ process_item_fn (EvolutionImporter *importer, } contact = gci->iterator->data; + + /* Apple's addressbook.app exports PHOTO's without a TYPE + param, so let's figure out the format here if there's a + PHOTO attribute missing a TYPE param. + + this is sort of a hack, as EContact sets the type for us if + we use the setter. so let's e_contact_get + e_contact_set + on E_CONTACT_PHOTO. + */ + photo = e_contact_get (contact, E_CONTACT_PHOTO); + if (photo) { + e_contact_set (contact, E_CONTACT_PHOTO, photo); + e_contact_photo_free (photo); + } + /* FIXME Error checking */ e_book_add_contact (gci->book, contact, NULL); -- cgit v1.2.3