Commit d255cd32 authored by Laurent Montel's avatar Laurent Montel 😁

Merge remote-tracking branch 'origin/Applications/17.04'

parents fb5dd883 82f01158
......@@ -186,8 +186,8 @@ void CSVImportExportPluginInterface::exportCSV()
return;
}
if (QFileInfo(url.isLocalFile() ? url.toLocalFile() : url.path()).exists()) {
if (url.isLocalFile() && QFileInfo(url.toLocalFile()).exists()) {
if (QFileInfo::exists(url.isLocalFile() ? url.toLocalFile() : url.path())) {
if (url.isLocalFile() && QFileInfo::exists(url.toLocalFile())) {
PimCommon::RenameFileDialog::RenameFileDialogResult result = PimCommon::RenameFileDialog::RENAMEFILE_IGNORE;
PimCommon::RenameFileDialog *dialog = new PimCommon::RenameFileDialog(url, false, parentWidget());
result = static_cast<PimCommon::RenameFileDialog::RenameFileDialogResult>(dialog->exec());
......
......@@ -115,9 +115,9 @@ void GMXImportExportPluginInterface::exportGMX()
return;
}
if (QFileInfo(url.isLocalFile() ?
url.toLocalFile() : url.path()).exists()) {
if (url.isLocalFile() && QFileInfo(url.toLocalFile()).exists()) {
if (QFileInfo::exists(url.isLocalFile() ?
url.toLocalFile() : url.path())) {
if (url.isLocalFile() && QFileInfo::exists(url.toLocalFile())) {
PimCommon::RenameFileDialog::RenameFileDialogResult result = PimCommon::RenameFileDialog::RENAMEFILE_IGNORE;
PimCommon::RenameFileDialog *dialog = new PimCommon::RenameFileDialog(url, false, parentWidget());
result = static_cast<PimCommon::RenameFileDialog::RenameFileDialogResult>(dialog->exec());
......
......@@ -179,8 +179,8 @@ void LDifImportExportPluginInterface::exportLdif()
} else {
QString fileName = url.toLocalFile();
if (QFileInfo(fileName).exists()) {
if (url.isLocalFile() && QFileInfo(url.toLocalFile()).exists()) {
if (QFileInfo::exists(fileName)) {
if (url.isLocalFile() && QFileInfo::exists(url.toLocalFile())) {
PimCommon::RenameFileDialog::RenameFileDialogResult result = PimCommon::RenameFileDialog::RENAMEFILE_IGNORE;
PimCommon::RenameFileDialog *dialog = new PimCommon::RenameFileDialog(url, false, parentWidget());
result = static_cast<PimCommon::RenameFileDialog::RenameFileDialogResult>(dialog->exec());
......
......@@ -429,7 +429,7 @@ void VCardImportExportPluginInterface::addKey(KContacts::Addressee &addr, KConta
bool VCardImportExportPluginInterface::doExport(const QUrl &url, const QByteArray &data) const
{
QUrl newUrl(url);
if (newUrl.isLocalFile() && QFileInfo(newUrl.toLocalFile()).exists()) {
if (newUrl.isLocalFile() && QFileInfo::exists(newUrl.toLocalFile())) {
PimCommon::RenameFileDialog *dialog = new PimCommon::RenameFileDialog(newUrl, false, parentWidget());
PimCommon::RenameFileDialog::RenameFileDialogResult result = static_cast<PimCommon::RenameFileDialog::RenameFileDialogResult>(dialog->exec());
if (result == PimCommon::RenameFileDialog::RENAMEFILE_RENAME) {
......
......@@ -294,7 +294,7 @@ public:
QUrl saveAsUrl =
QFileDialog::getSaveFileUrl(nullptr, i18n("Save Business Card"), QUrl::fromUserInput(fileName));
if (saveAsUrl.isEmpty() ||
(QFileInfo(saveAsUrl.path()).exists() &&
(QFileInfo::exists(saveAsUrl.path()) &&
(KMessageBox::warningYesNo(
nullptr,
i18n("%1 already exists. Do you want to overwrite it?",
......
......@@ -183,7 +183,7 @@ void ViewerPluginExternalConfigureWidget::save()
if (filenamepath.isEmpty()) {
filenamepath = writablePath + QStringLiteral("%1.desktop").arg(scriptInfo.name());
int fileIndex = 1;
while(QFileInfo(filenamepath).exists()) {
while(QFileInfo::exists(filenamepath)) {
filenamepath = writablePath + QStringLiteral("%1-%2.desktop").arg(scriptInfo.name()).arg(fileIndex);
fileIndex++;
}
......
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