Introduce FileSaverOptions to consolidate common parameters
This commit is contained in:
@ -71,9 +71,16 @@ int CommandAdd::handle(QStringList arguments)
|
||||
}
|
||||
}
|
||||
|
||||
FileSaverOptions fileSaverOptions;
|
||||
fileSaverOptions.keepGoing = keepGoing;
|
||||
fileSaverOptions.fillPathsOnlyWithContent = fillContent;
|
||||
fileSaverOptions.pathsOnly = pathsOnly;
|
||||
fileSaverOptions.verbose = false;
|
||||
|
||||
indexer = new Indexer(*this->dbService);
|
||||
indexer->setFileSaverOptions(fileSaverOptions);
|
||||
|
||||
indexer->setTargetPaths(files.toVector());
|
||||
indexer->setKeepGoing(keepGoing);
|
||||
|
||||
connect(indexer, &Indexer::pathsCountChanged, this,
|
||||
[](int pathsCount) { Logger::info() << "Found paths: " << pathsCount << Qt::endl; });
|
||||
|
@ -40,8 +40,12 @@ int CommandUpdate::handle(QStringList arguments)
|
||||
|
||||
bool hasErrors = false;
|
||||
IndexSyncer *syncer = new IndexSyncer(*this->dbService);
|
||||
syncer->setKeepGoing(keepGoing);
|
||||
syncer->setVerbose(verbose);
|
||||
|
||||
FileSaverOptions fileOptions;
|
||||
fileOptions.keepGoing = keepGoing;
|
||||
fileOptions.verbose = verbose;
|
||||
|
||||
syncer->setFileSaverOptions(fileOptions);
|
||||
syncer->setPattern(pattern);
|
||||
syncer->setDryRun(dryRun);
|
||||
syncer->setRemoveDeletedFromIndex(deleteMissing);
|
||||
|
Reference in New Issue
Block a user