From 1af08c0c52300477a573820f07f924dbd91ae09c Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Thu, 10 Jul 2025 03:12:43 -0700 Subject: [PATCH] core: only call QmlScanner::scanDir() on directories Removes a bogus warning message. --- src/core/scan.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/core/scan.cpp b/src/core/scan.cpp index b84b3d86..3f5e0923 100644 --- a/src/core/scan.cpp +++ b/src/core/scan.cpp @@ -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); }