cli: commanddelete: fix broken dry-run

This commit is contained in:
Albert S. 2019-04-29 10:24:50 +02:00
parent 021722b090
commit ec1219acda

View File

@ -16,11 +16,11 @@ int CommandDelete::removeNonExistent(bool verbose, bool dryRun, QString pattern)
while(processedRows > 0 )
{
for(FileData &file : files)
{
if(!dryRun)
{
QFileInfo fileInfo(file.absPath);
if(!fileInfo.exists())
{
if(!dryRun)
{
if(this->dbService->deleteFile(file.absPath))
{
@ -36,15 +36,15 @@ int CommandDelete::removeNonExistent(bool verbose, bool dryRun, QString pattern)
return 1;
}
}
}
else
{
Logger::info() << "Would delete " << file.absPath << endl;
}
}
}
offset += limit;
processedRows = this->dbService->getFiles(files, pattern, 0, limit);
processedRows = this->dbService->getFiles(files, pattern, offset, limit);
}
return 0;
}