diff options
author | Chris Toshok <toshok@ximian.com> | 2004-03-31 06:19:22 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2004-03-31 06:19:22 +0800 |
commit | d87e7fd2c87f502414ed1aaacba85a1de3287917 (patch) | |
tree | 95b579cc63cbb0cda99d2fba6cc762ba51755033 /addressbook/importers | |
parent | 11917a5d5b356bd3e9bf00f4c3963c6ce9b3ca39 (diff) | |
download | gsoc2013-evolution-d87e7fd2c87f502414ed1aaacba85a1de3287917.tar.gz gsoc2013-evolution-d87e7fd2c87f502414ed1aaacba85a1de3287917.tar.zst gsoc2013-evolution-d87e7fd2c87f502414ed1aaacba85a1de3287917.zip |
[ part of the fix for #54528, the other part is in e-d-s ]
2004-03-30 Chris Toshok <toshok@ximian.com>
[ 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
Diffstat (limited to 'addressbook/importers')
-rw-r--r-- | addressbook/importers/evolution-vcard-importer.c | 16 |
1 files changed, 16 insertions, 0 deletions
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); |