diff --git a/src/core/scan.cpp b/src/core/scan.cpp index 45413fb..d9606bc 100644 --- a/src/core/scan.cpp +++ b/src/core/scan.cpp @@ -19,12 +19,13 @@ QS_LOGGING_CATEGORY(logQmlScanner, "quickshell.qmlscanner", QtWarningMsg); -void QmlScanner::scanDir(const QString& path) { - if (this->scannedDirs.contains(path)) return; - this->scannedDirs.push_back(path); +void QmlScanner::scanDir(const QDir& dir) { + if (this->scannedDirs.contains(dir)) return; + this->scannedDirs.push_back(dir); + + const auto& path = dir.path(); qCDebug(logQmlScanner) << "Scanning directory" << path; - auto dir = QDir(path); struct Entry { QString name; @@ -166,7 +167,7 @@ bool QmlScanner::scanQmlFile(const QString& path, bool& singleton, bool& interna auto currentdir = QDir(QFileInfo(path).absolutePath()); // the root can never be a singleton so it dosent matter if we skip it - this->scanDir(currentdir.path()); + this->scanDir(currentdir); for (auto& import: imports) { QString ipath; diff --git a/src/core/scan.hpp b/src/core/scan.hpp index 9d88f07..2dc8c3c 100644 --- a/src/core/scan.hpp +++ b/src/core/scan.hpp @@ -16,10 +16,10 @@ public: QmlScanner() = default; QmlScanner(const QDir& rootPath): rootPath(rootPath) {} - void scanDir(const QString& path); + void scanDir(const QDir& dir); void scanQmlRoot(const QString& path); - QVector scannedDirs; + QVector scannedDirs; QVector scannedFiles; QHash fileIntercepts;