Commit 79e78308 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to import several contacts

parent a9e7aff1
Pipeline #29849 failed with stage
in 110 minutes and 35 seconds
......@@ -90,17 +90,19 @@ void WindowsContactImportExportPluginInterface::exec()
void WindowsContactImportExportPluginInterface::importWindowsContact()
{
const QString fileName
= QFileDialog::getOpenFileName(parentWidget(), QString(), QDir::homePath(), i18n("Windows Contact file (*.contact)"));
const QStringList fileNames
= QFileDialog::getOpenFileNames(parentWidget(), QString(), QDir::homePath(), i18n("Windows Contact file (*.contact)"));
if (fileName.isEmpty()) {
if (fileNames.isEmpty()) {
return;
}
KContacts::Addressee::List addresseeList;
ImportWindowContact importer;
importer.setParentWidget(parentWidget());
addresseeList = importer.importFile(fileName);
for (const QString &fileName : fileNames) {
addresseeList.append(importer.importFile(fileName));
}
KAddressBookImportExport::KAddressBookImportExportContactList contactList;
contactList.setAddressList(addresseeList);
......
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