Skip to content

Commit

Permalink
Merge pull request #129 from saeugetier/127-deleting-images-will-only…
Browse files Browse the repository at this point in the history
…-remove-raw-images

127 deleting images will only remove raw images
  • Loading branch information
saeugetier authored May 19, 2024
2 parents f94e90a + b2b6331 commit cad298e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ void FileSystem::deleteAllImages()
imagePath = imagePath.right(imagePath.length() - QString("file://").length());
QDir imageDir(imagePath);
QStringList filters;
filters << "*.jpg" << "*.JPG";
filters << "*.jpg" << "*.JPG" << "*.png" << "*.PNG";
imageDir.setFilter(QDir::Files);
imageDir.setNameFilters(filters);
if(!imageDir.isEmpty() && imageDir.exists())
Expand All @@ -224,6 +224,8 @@ void FileSystem::deleteAllImages()
}

imageDir.setPath(imagePath + "/collage");
imageDir.setFilter(QDir::Files);
imageDir.setNameFilters(filters);
if(!imageDir.isEmpty() && imageDir.exists())
{
QStringList files = imageDir.entryList(filters, QDir::Files);
Expand All @@ -232,7 +234,7 @@ void FileSystem::deleteAllImages()
for(i = 0; i < files.count(); i++)
{
qDebug() << "removing file: " << files[i];
QFile::remove(imagePath + "/" + files[i]);
QFile::remove(imagePath + "/collage/" + files[i]);
}
}

Expand Down

0 comments on commit cad298e

Please sign in to comment.