Commit fed66bf1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Don't ask overwrite file twice

parent b180f26d
......@@ -180,7 +180,8 @@ void CSVImportExportPluginInterface::exportCSV()
KAddressBookImportExport::KAddressBookImportExportContactList contactLists;
contactLists.setAddressList(contacts);
QUrl url = QFileDialog::getSaveFileUrl(parentWidget(), QString(), QUrl::fromLocalFile(QStringLiteral("addressbook.csv")));
QFileDialog::Options options = QFileDialog::DontConfirmOverwrite;
QUrl url = QFileDialog::getSaveFileUrl(parentWidget(), QString(), QUrl::fromLocalFile(QStringLiteral("addressbook.csv")), QString(), Q_NULLPTR, options);
if (url.isEmpty()) {
return;
}
......
......@@ -109,8 +109,8 @@ void GMXImportExportPluginInterface::exportGMX()
KAddressBookImportExport::KAddressBookImportExportContactList contactLists;
contactLists.setAddressList(contacts);
QUrl url = QFileDialog::getSaveFileUrl(parentWidget(), QString(), QUrl::fromLocalFile(QDir::homePath() + QLatin1String("/addressbook.gmx")), GMX_FILESELECTION_STRING);
QFileDialog::Options options = QFileDialog::DontConfirmOverwrite;
QUrl url = QFileDialog::getSaveFileUrl(parentWidget(), QString(), QUrl::fromLocalFile(QDir::homePath() + QLatin1String("/addressbook.gmx")), GMX_FILESELECTION_STRING, Q_NULLPTR, options);
if (url.isEmpty()) {
return;
}
......
......@@ -154,8 +154,10 @@ void LDifImportExportPluginInterface::exportLdif()
KAddressBookImportExport::KAddressBookImportExportContactList contactLists;
contactLists.setAddressList(contacts);
QFileDialog::Options options = QFileDialog::DontConfirmOverwrite;
const QUrl url =
QFileDialog::getSaveFileUrl(parentWidget(), QString(), QUrl::fromLocalFile(QDir::homePath() + QLatin1String("/addressbook.ldif")), i18n("LDif Files (*.ldif)"));
QFileDialog::getSaveFileUrl(parentWidget(), QString(), QUrl::fromLocalFile(QDir::homePath() + QLatin1String("/addressbook.ldif")),
i18n("LDif Files (*.ldif)"), Q_NULLPTR, options);
if (url.isEmpty()) {
return;
}
......
......@@ -482,11 +482,13 @@ void VCardImportExportPluginInterface::exportVCard()
bool ok = true;
if (list.count() == 1) {
QFileDialog::Options options = QFileDialog::DontConfirmOverwrite;
url = QFileDialog::getSaveFileUrl(parentWidget(), QString(), QUrl::fromLocalFile(
QString(list[ 0 ].givenName() +
QLatin1Char(QLatin1Char('_')) +
list[ 0 ].familyName() +
QLatin1String(".vcf"))));
QLatin1String(".vcf")))
, QString(), Q_NULLPTR, options);
if (url.isEmpty()) { // user canceled export
return;
}
......@@ -543,7 +545,8 @@ void VCardImportExportPluginInterface::exportVCard()
break;
}
case KMessageBox::Yes: {
url = QFileDialog::getSaveFileUrl(parentWidget(), QString(), QUrl::fromLocalFile(QStringLiteral("addressbook.vcf")));
QFileDialog::Options options = QFileDialog::DontConfirmOverwrite;
url = QFileDialog::getSaveFileUrl(parentWidget(), QString(), QUrl::fromLocalFile(QStringLiteral("addressbook.vcf")), QString(), Q_NULLPTR, options);
if (url.isEmpty()) {
return; // user canceled export
}
......
Supports Markdown
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