File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change 99#include < qlist.h>
1010#include < qlogging.h>
1111#include < qloggingcategory.h>
12- #include < qnamespace .h>
12+ #include < qqmlengine .h>
1313#include < qtenvironmentvariables.h>
1414
1515#include " logcat.hpp"
@@ -78,16 +78,10 @@ bool QmlToolingSupport::lockTooling() {
7878
7979QString QmlToolingSupport::getQmllsConfig () {
8080 static auto config = []() {
81- QList<QString> importPaths;
82-
83- auto addPaths = [&](const QList<QString>& paths) {
84- for (const auto & path: paths) {
85- if (!importPaths.contains (path)) importPaths.append (path);
86- }
87- };
88-
89- addPaths (qEnvironmentVariable (" QML_IMPORT_PATH" ).split (u' :' , Qt::SkipEmptyParts));
90- addPaths (qEnvironmentVariable (" QML2_IMPORT_PATH" ).split (u' :' , Qt::SkipEmptyParts));
81+ // We can't replicate the algorithm used to create the import path list as it can have distro
82+ // specific patches, e.g. nixos.
83+ auto importPaths = QQmlEngine ().importPathList ();
84+ importPaths.removeIf ([](const QString& path) { return path.startsWith (" qrc:" ); });
9185
9286 auto vfsPath = QsPaths::instance ()->shellVfsDir ()->path ();
9387 auto importPathsStr = importPaths.join (u' :' );
You can’t perform that action at this time.
0 commit comments