Commit 0a044c5c authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

RecipientLineNG: improve parsing of email into the data

Set Recipient::name and Recipient::email respectively.
parent 819c3e02
......@@ -166,7 +166,13 @@ void RecipientLineNG::dataFromFields()
if (!mData) {
return;
}
mData->setEmail(mEdit->text());
QString displayName, addrSpec, comment;
if (KEmailAddress::splitAddress(mEdit->text(), displayName, addrSpec, comment) == KEmailAddress::AddressOk) {
mData->setName(displayName);
mData->setEmail(addrSpec);
} else {
mData->setEmail(mEdit->text());
}
mData->setType(Recipient::idToType(mCombo->currentIndex()));
mModified = false;
}
......
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