QmlJS: Allow scan of files

Change-Id: I25fd0d76cf69fa144112de96cc677d6f316da736
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
This commit is contained in:
Christian Stenger
2014-11-10 13:23:44 +01:00
committed by Christian Stenger
parent aa34d93e3c
commit 8f546fee37
2 changed files with 3 additions and 4 deletions

View File

@@ -965,7 +965,7 @@ struct ScanItem {
void ModelManagerInterface::importScan(QFutureInterface<void> &future,
ModelManagerInterface::WorkingCopy workingCopy,
PathsAndLanguages paths, ModelManagerInterface *modelManager,
bool emitDocChangedOnDisk)
bool emitDocChangedOnDisk, bool libOnly)
{
// paths we have scanned for files and added to the files list
QSet<QString> scannedPaths;
@@ -993,7 +993,6 @@ void ModelManagerInterface::importScan(QFutureInterface<void> &future,
int progressRange = pathsToScan.size() * (1 << (2 + maxScanDepth));
int totalWork(progressRange), workDone(0);
future.setProgressRange(0, progressRange); // update max length while iterating?
const bool libOnly = true; // FIXME remove when tested more
const Snapshot snapshot = modelManager->snapshot();
while (!pathsToScan.isEmpty() && !future.isCanceled()) {
ScanItem toScan = pathsToScan.last();
@@ -1075,7 +1074,7 @@ void ModelManagerInterface::maybeScan(const PathsAndLanguages &importPaths)
if (pathToScan.length() > 1) {
QFuture<void> result = QtConcurrent::run(&ModelManagerInterface::importScan,
workingCopyInternal(), pathToScan,
this, true);
this, true, true);
if (m_synchronizer.futures().size() > 10) {
QList<QFuture<void> > futures = m_synchronizer.futures();