Summary: | Trouble importing apple addressbook vcard into kaddressbook | ||
---|---|---|---|
Product: | kab3 | Reporter: | Sitsofe Wheeler <sitsofe> |
Component: | general | Assignee: | Tobias Koenig <tokoe> |
Status: | RESOLVED UNMAINTAINED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | 3.3 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | Vcard exported from Apple Addressbook |
Description
Sitsofe Wheeler
2005-01-04 00:57:55 UTC
Created attachment 8907 [details]
Vcard exported from Apple Addressbook
Hi, I changed it to a whishlist item, because this vCard uses a special vCard feature called grouping which isn't implemented in our vCard parser yet. To the other issues: 1) department and profession are non standardized fields which every addressbook application handles differently, adding hacks for it doesn't make much sense and leads to ugly code 2) the photo entry is invalid, concerning the vCard standard (RFC2426) it must contain a type field I've just been reading RFC2426 and I have failed to find the section that says a photo must have a type field. From reading of the grammar (http://zvon.org/tmRFC/RFC2426/Output/index.html ) my understanding is that it is completely optional because of this: contentline = [group "."] name *(";" param ) ":" value CRLF * means 0 or more and since the parameters can be any order there need not be a type field (although that BASE64 bit looks suspicious). CVS commit by tokoe: Parse images from Apples MacOSX addressbook correctly. BUG:96263 M +5 -3 vcardtool.cpp 1.11 M +3 -0 vcardparser/vcardparser.cpp 1.16 --- kdelibs/kabc/vcardtool.cpp #1.10:1.11 @@ -623,7 +623,9 @@ Picture VCardTool::parsePicture( const V QStringList params = line.parameterList(); - if ( params.findIndex( "encoding" ) != -1 ) - pic.setData( line.value().asByteArray() ); - else if ( params.findIndex( "value" ) != -1 ) { + if ( params.findIndex( "encoding" ) != -1 ) { + QImage img; + img.loadFromData( line.value().asByteArray() ); + pic.setData( img ); + } else if ( params.findIndex( "value" ) != -1 ) { if ( line.parameter( "value" ).lower() == "uri" ) pic.setUrl( line.value().asString() ); --- kdelibs/kabc/vcardparser/vcardparser.cpp #1.15:1.16 @@ -77,4 +77,7 @@ VCard::List VCardParser::parseVCards( co pair[0] = "encoding"; pair[1] = "quoted-printable"; + } else if ( pair[0].lower() == "base64" ) { + pair[0] = "encoding"; + pair[1] = "base64"; } else { pair.prepend( "type" ); Woah there! First up thanks for the photo fix. However you mentioned making lack of grouping support a wishlist proposal... Do you want me to spin that off into a different bug? On Sun, Jan 09, 2005 at 09:18:25PM -0000, Sitsofe Wheeler wrote:
Hi,
> Woah there! First up thanks for the photo fix. However you mentioned making
> lack of grouping support a wishlist proposal... Do you want me to spin that
> off into a different bug?
That's fixed in the meantime as well.
Ciao,
Tobias
The development of the old KAddressBook will be discontinued for KDE 4.4. Since the new application has the same name, but a completly new code base we close all bug reports against the old version and ask the submitters to resend there reports against the new product. |