[Bug 293098] KAddressbook/Akonadi stores CATEGORIES escaped the wrong way

Ingo Ratsdorf ingo at envirology.co.nz
Fri Jun 1 06:09:09 BST 2012


https://bugs.kde.org/show_bug.cgi?id=293098

--- Comment #8 from Ingo Ratsdorf <ingo at envirology.co.nz> ---
vcardtool assumes that categories are stored in a QStringList:

creating VCard data

142        if ( version == VCard::v3_0 ) {
143          QStringList categories = (*addrIt).categories();
144          QStringList::Iterator catIt;
145          for ( catIt = categories.begin(); catIt != categories.end();
++catIt ) {
146            (*catIt).replace( QLatin1Char( ',' ), QLatin1String( "\\," ) );
147          }
148    
149          VCardLine catLine( QLatin1String( "CATEGORIES" ), categories.join(
QLatin1String( "," ) ) );
150          card.addLine( catLine );
151        }

The code seems to be okay. It replaces all commas within each string (category)
with '\,' which is correct.
It then joins it all together using plain ','.
This is according to RFC

parsing VCard Data

364      static const QLatin1Char commaSep( ',' );

428            else if ( identifier == QLatin1String( "categories" ) ) {
429              const QStringList categories = splitString( commaSep,
(*lineIt).value().toString() );
430              addr.setCategories( categories );
431            }

Addr is apparently defined in kabc/addressee.cpp, however I cannot find that
file!!!

=====================

ASSUMPTION: KAddressbook or underlaying packages are not using QStringlist but
store one single CATEGORIES string in QStringlist,
hence all commas within are replaced.

Does that make sense to anyone?

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Kdepim-bugs mailing list