summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-04 06:22:02 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-04 06:22:02 (GMT)
commitfed66bf18bfc0bb97f1c1d6c194b0bdea65c6e6c (patch)
treefa6d0d5035f6fda52682b120cb705a900602a9ff
parentb180f26d345e3093fa339c1e6f069007adb5abe5 (diff)
Don't ask overwrite file twice
-rw-r--r--kaddressbook/importexportplugins/csv/csvimportexportplugininterface.cpp3
-rw-r--r--kaddressbook/importexportplugins/gmx/gmximportexportplugininterface.cpp4
-rw-r--r--kaddressbook/importexportplugins/ldif/ldifimportexportplugininterface.cpp4
-rw-r--r--kaddressbook/importexportplugins/vcards/vcardimportexportplugininterface.cpp7
4 files changed, 12 insertions, 6 deletions
diff --git a/kaddressbook/importexportplugins/csv/csvimportexportplugininterface.cpp b/kaddressbook/importexportplugins/csv/csvimportexportplugininterface.cpp
index 697eb19..b405e70 100644
--- a/kaddressbook/importexportplugins/csv/csvimportexportplugininterface.cpp
+++ b/kaddressbook/importexportplugins/csv/csvimportexportplugininterface.cpp
@@ -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;
}
diff --git a/kaddressbook/importexportplugins/gmx/gmximportexportplugininterface.cpp b/kaddressbook/importexportplugins/gmx/gmximportexportplugininterface.cpp
index 7158dde..12c4bf5 100644
--- a/kaddressbook/importexportplugins/gmx/gmximportexportplugininterface.cpp
+++ b/kaddressbook/importexportplugins/gmx/gmximportexportplugininterface.cpp
@@ -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;
}
diff --git a/kaddressbook/importexportplugins/ldif/ldifimportexportplugininterface.cpp b/kaddressbook/importexportplugins/ldif/ldifimportexportplugininterface.cpp
index 94c6533..fd57a82 100644
--- a/kaddressbook/importexportplugins/ldif/ldifimportexportplugininterface.cpp
+++ b/kaddressbook/importexportplugins/ldif/ldifimportexportplugininterface.cpp
@@ -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;
}
diff --git a/kaddressbook/importexportplugins/vcards/vcardimportexportplugininterface.cpp b/kaddressbook/importexportplugins/vcards/vcardimportexportplugininterface.cpp
index 0ff4a6f..a6da9e9 100644
--- a/kaddressbook/importexportplugins/vcards/vcardimportexportplugininterface.cpp
+++ b/kaddressbook/importexportplugins/vcards/vcardimportexportplugininterface.cpp
@@ -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
}