1919
2020QS_LOGGING_CATEGORY (logQmlScanner, " quickshell.qmlscanner" , QtWarningMsg);
2121
22- void QmlScanner::scanDir (const QString& path) {
23- if (this ->scannedDirs .contains (path)) return ;
24- this ->scannedDirs .push_back (path);
22+ void QmlScanner::scanDir (const QDir& dir) {
23+ if (this ->scannedDirs .contains (dir)) return ;
24+ this ->scannedDirs .push_back (dir);
25+
26+ const auto & path = dir.path ();
2527
2628 qCDebug (logQmlScanner) << " Scanning directory" << path;
27- auto dir = QDir (path);
2829
2930 struct Entry {
3031 QString name;
@@ -163,10 +164,10 @@ bool QmlScanner::scanQmlFile(const QString& path, bool& singleton, bool& interna
163164 qCDebug (logQmlScanner) << " Found imports" << imports;
164165 }
165166
166- auto currentdir = QDir (QFileInfo (path).canonicalPath ());
167+ auto currentdir = QDir (QFileInfo (path).absolutePath ());
167168
168169 // the root can never be a singleton so it dosent matter if we skip it
169- this ->scanDir (currentdir. path () );
170+ this ->scanDir (currentdir);
170171
171172 for (auto & import : imports) {
172173 QString ipath;
@@ -179,9 +180,9 @@ bool QmlScanner::scanQmlFile(const QString& path, bool& singleton, bool& interna
179180 }
180181
181182 auto pathInfo = QFileInfo (ipath);
182- auto cpath = pathInfo.canonicalFilePath ();
183+ auto cpath = pathInfo.absoluteFilePath ();
183184
184- if (cpath. isEmpty ()) {
185+ if (!pathInfo. exists ()) {
185186 qCWarning (logQmlScanner) << " Ignoring unresolvable import" << ipath << " from" << path;
186187 continue ;
187188 }
0 commit comments