Commit 040dcdec authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add messagebox when we don't want to override file

parent 11c68357
...@@ -99,7 +99,13 @@ void ShowArchiveStructureDialog::slotExtractFile() ...@@ -99,7 +99,13 @@ void ShowArchiveStructureDialog::slotExtractFile()
QFileDialog::ShowDirsOnly QFileDialog::ShowDirsOnly
| QFileDialog::DontResolveSymlinks); | QFileDialog::DontResolveSymlinks);
if (!dir.isEmpty()) { if (!dir.isEmpty()) {
if (QFile(dir + QLatin1Char('/') + currentFile->name()).exists()) {
if (KMessageBox::questionYesNo(this, i18n("Do you want to override %1", currentFile->name()), i18n("File Already Exist") ) == KMessageBox::No) {
return;
}
}
if (!currentFile->copyTo(dir)) { if (!currentFile->copyTo(dir)) {
KMessageBox::error(this, i18n("Impossible to copy %1 in %2.", currentFile->name()), dir);
qCWarning(PIMDATAEXPORTERGUI_LOG) << "Impossible to extract file: " << currentItem->text(0) << " to " << dir; qCWarning(PIMDATAEXPORTERGUI_LOG) << "Impossible to extract file: " << currentItem->text(0) << " to " << dir;
} }
} }
......
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