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