Skip to content

Commit 1af08c0

Browse files
committed
core: only call QmlScanner::scanDir() on directories
Removes a bogus warning message.
1 parent 4b35d7b commit 1af08c0

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/core/scan.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ void QmlScanner::scanDir(const QString& path) {
6565
|| c == '_')
6666
{
6767
} else {
68-
qCWarning(logQmlScanner)
69-
<< "Module path contains invalid characters for a module name: " << end;
68+
qCWarning(logQmlScanner) << "Module path contains invalid characters for a module name: "
69+
<< path.sliced(this->rootPath.path().length());
7070
goto skipadd;
7171
}
7272
}
@@ -170,13 +170,19 @@ bool QmlScanner::scanQmlFile(const QString& path) {
170170
ipath = currentdir.filePath(import);
171171
}
172172

173-
auto cpath = QFileInfo(ipath).canonicalFilePath();
173+
auto pathInfo = QFileInfo(ipath);
174+
auto cpath = pathInfo.canonicalFilePath();
174175

175176
if (cpath.isEmpty()) {
176177
qCWarning(logQmlScanner) << "Ignoring unresolvable import" << ipath << "from" << path;
177178
continue;
178179
}
179180

181+
if (!pathInfo.isDir()) {
182+
qCDebug(logQmlScanner) << "Ignoring non-directory import" << ipath << "from" << path;
183+
continue;
184+
}
185+
180186
if (import.endsWith(".js")) this->scannedFiles.push_back(cpath);
181187
else this->scanDir(cpath);
182188
}

0 commit comments

Comments
 (0)