ark: check for single folder archives when extracting and auto sub-folder option is on

if the archive is single folder and the directory exists ark will ask if
overwriting should be done

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-05-18 23:51:23 +03:00
parent 150c78e3f1
commit 4696a44ada
2 changed files with 2 additions and 2 deletions

View file

@ -68,7 +68,7 @@ void BatchExtract::addExtraction(Kerfuffle::Archive* archive)
{ {
QString destination = destinationFolder(); QString destination = destinationFolder();
if (autoSubfolder()) { if (autoSubfolder() && !archive->isSingleFolderArchive()) {
const QDir d(destination); const QDir d(destination);
QString subfolderName = archive->subfolderName(); QString subfolderName = archive->subfolderName();

View file

@ -684,7 +684,7 @@ void Part::slotExtractFiles()
options[QLatin1String("FollowExtractionDialogSettings")] = true; options[QLatin1String("FollowExtractionDialogSettings")] = true;
QString destinationDirectory = dialog.data()->destinationDirectory(); QString destinationDirectory = dialog.data()->destinationDirectory();
if (dialog.data()->autoSubfolders()) { if (dialog.data()->autoSubfolders() && !isSingleFolderArchive()) {
QString subFolder = detectSubfolder(); QString subFolder = detectSubfolder();
if (!subFolder.isEmpty()) { if (!subFolder.isEmpty()) {
// do what batch extraction does, create the folder or automatically pick other if it // do what batch extraction does, create the folder or automatically pick other if it