cli: commanddelete: fix broken dry-run
This commit is contained in:
orang tua
2cf26a17e1
melakukan
0d3cfefb36
@ -16,11 +16,11 @@ int CommandDelete::removeNonExistent(bool verbose, bool dryRun, QString pattern)
|
|||||||
while(processedRows > 0)
|
while(processedRows > 0)
|
||||||
{
|
{
|
||||||
for(FileData &file : files)
|
for(FileData &file : files)
|
||||||
{
|
|
||||||
if(!dryRun)
|
|
||||||
{
|
{
|
||||||
QFileInfo fileInfo(file.absPath);
|
QFileInfo fileInfo(file.absPath);
|
||||||
if(!fileInfo.exists())
|
if(!fileInfo.exists())
|
||||||
|
{
|
||||||
|
if(!dryRun)
|
||||||
{
|
{
|
||||||
if(this->dbService->deleteFile(file.absPath))
|
if(this->dbService->deleteFile(file.absPath))
|
||||||
{
|
{
|
||||||
@ -35,14 +35,15 @@ int CommandDelete::removeNonExistent(bool verbose, bool dryRun, QString pattern)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Logger::info() << "Would delete " << file.absPath << endl;
|
Logger::info() << "Would delete " << file.absPath << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
offset += limit;
|
offset += limit;
|
||||||
processedRows = this->dbService->getFiles(files, pattern, 0, limit);
|
processedRows = this->dbService->getFiles(files, pattern, offset, limit);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Memuat…
Reference in New Issue
Block a user