Commit 323e63d6 authored by blam's avatar blam

[buteo-sync-plugin-carddav] Fix handling of empty contact name. JB#48429

Fix some cases that occur when both first and last name are empty for
a contact:

- The "N" field was set to a string containing semicolons, and this
string was escaped when encoded by QVersitWriter. To avoid this
escaping, add the property as a string list CompoundType instead of a
string.

- Don't include the first/last name in the "N" values as the display
label is already added to the "FN" field anyway.
parent 1d457080
......@@ -370,9 +370,10 @@ void CardDavVCardConverter::contactProcessed(const QContact &c, QVersitDocument
// then just assume that the display label is a useful first name.
name.setFirstName(displaylabel);
}
QString nvalue = QStringLiteral("%1;%2;;;").arg(name.lastName(), name.firstName());
static const QStringList nvalue = { "", "", "", "", "" };
QVersitProperty nProp;
nProp.setName("N");
nProp.setValueType(QVersitProperty::CompoundType);
nProp.setValue(nvalue);
d->addProperty(nProp);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment