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

View File

@@ -210,7 +210,7 @@ public:
WorkingCopy workingCopyInternal, WorkingCopy workingCopyInternal,
PathsAndLanguages paths, PathsAndLanguages paths,
ModelManagerInterface *modelManager, ModelManagerInterface *modelManager,
bool emitDocChangedOnDisk); bool emitDocChangedOnDisk, bool libOnly = true);
public slots: public slots:
virtual void resetCodeModel(); virtual void resetCodeModel();
void removeProjectInfo(ProjectExplorer::Project *project); void removeProjectInfo(ProjectExplorer::Project *project);