Introduce FileSaverOptions to consolidate common parameters

This commit is contained in:
2023-01-08 17:37:28 +01:00
parent efca45b88a
commit 4b1522b82a
11 changed files with 77 additions and 53 deletions

View File

@@ -73,16 +73,6 @@ void Indexer::setTargetPaths(QVector<QString> pathsToScan)
this->pathsToScan = pathsToScan;
}
void Indexer::setVerbose(bool verbose)
{
this->verbose = verbose;
}
void Indexer::setKeepGoing(bool keepGoing)
{
this->keepGoing = keepGoing;
}
void Indexer::requestCancellation()
{
this->dirScanner->cancel();
@@ -123,7 +113,7 @@ void Indexer::processFileScanResult(FileScanResult result)
if(isErrorSaveFileResult(result.second))
{
this->currentIndexResult.results.append(result);
if(!keepGoing)
if(!this->fileSaverOptions.keepGoing)
{
this->requestCancellation();
emit finished();
@@ -132,7 +122,7 @@ void Indexer::processFileScanResult(FileScanResult result)
}
else
{
if(verbose)
if(this->fileSaverOptions.verbose)
{
this->currentIndexResult.results.append(result);
}
@@ -175,3 +165,8 @@ void Indexer::processFinishedWorker()
emit finished();
}
}
void Indexer::setFileSaverOptions(FileSaverOptions options)
{
this->fileSaverOptions = options;
}