core: only call QmlScanner::scanDir() on directories

Removes a bogus warning message.
This commit is contained in:
outfoxxed 2025-07-10 03:12:43 -07:00
parent 4b35d7b51b
commit 1af08c0c52
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E

View file

@ -65,8 +65,8 @@ void QmlScanner::scanDir(const QString& path) {
|| c == '_')
{
} else {
qCWarning(logQmlScanner)
<< "Module path contains invalid characters for a module name: " << end;
qCWarning(logQmlScanner) << "Module path contains invalid characters for a module name: "
<< path.sliced(this->rootPath.path().length());
goto skipadd;
}
}
@ -170,13 +170,19 @@ bool QmlScanner::scanQmlFile(const QString& path) {
ipath = currentdir.filePath(import);
}
auto cpath = QFileInfo(ipath).canonicalFilePath();
auto pathInfo = QFileInfo(ipath);
auto cpath = pathInfo.canonicalFilePath();
if (cpath.isEmpty()) {
qCWarning(logQmlScanner) << "Ignoring unresolvable import" << ipath << "from" << path;
continue;
}
if (!pathInfo.isDir()) {
qCDebug(logQmlScanner) << "Ignoring non-directory import" << ipath << "from" << path;
continue;
}
if (import.endsWith(".js")) this->scannedFiles.push_back(cpath);
else this->scanDir(cpath);
}