qmljs: fix qml scan sequence and progress

Change-Id: I8aafb23f1708400936507ab75e4c2893906f9aff
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
Fawzi Mohamed
2014-05-26 18:20:00 +02:00
parent 34f48ea0c0
commit d17157f83a

View File

@@ -954,7 +954,7 @@ void ModelManagerInterface::importScan(QFutureInterface<void> &future,
while (!pathsToScan.isEmpty() && !future.isCanceled()) {
ScanItem toScan = pathsToScan.last();
pathsToScan.pop_back();
int pathBudget = (maxScanDepth + 2 - toScan.depth);
int pathBudget = (1 << (maxScanDepth + 2 - toScan.depth));
if (!scannedPaths.contains(toScan.path)) {
QStringList importedFiles;
if (!findNewQmlLibraryInPath(toScan.path, snapshot, modelManager, &importedFiles,
@@ -979,7 +979,7 @@ void ModelManagerInterface::importScan(QFutureInterface<void> &future,
// always descend tree, as we might have just scanned with a smaller depth
if (toScan.depth < maxScanDepth) {
QDir dir(toScan.path);
QStringList subDirs(dir.entryList(QDir::Dirs));
QStringList subDirs(dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot));
workDone += 1;
totalWork += pathBudget / 2 * subDirs.size() - pathBudget * 3 / 4 + 1;
foreach (const QString path, subDirs)