Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 56d7f5c5 authored by Laurent Montel's avatar Laurent Montel 😁

Allow to select multi emails

parent d42a9633
......@@ -75,13 +75,23 @@ void EmailLineEdit::slotSelectEmail()
std::unique_ptr<Akonadi::EmailAddressSelectionDialog> dlg(
new Akonadi::EmailAddressSelectionDialog(this));
dlg->setWindowTitle(i18n("Select Emails"));
dlg->view()->view()->setSelectionMode(QAbstractItemView::SingleSelection);
dlg->view()->view()->setSelectionMode(multiSelection() ? QAbstractItemView::MultiSelection : QAbstractItemView::SingleSelection);
if (dlg->exec()) {
QStringList addresses;
const Akonadi::EmailAddressSelection::List lstAddress = dlg->selectedAddresses();
if (!lstAddress.isEmpty()) {
mLineEdit->setText(lstAddress.constFirst().email());
bool firstElement = true;
QString result;
for (const Akonadi::EmailAddressSelection &value : lstAddress) {
if (!firstElement) {
result.append(QLatin1Char(';'));
} else {
firstElement = false;
}
result.append(value.email());
}
mLineEdit->setText(result);
}
}
}
......
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