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 9
9
#include < qlist.h>
10
10
#include < qlogging.h>
11
11
#include < qloggingcategory.h>
12
- #include < qnamespace .h>
12
+ #include < qqmlengine .h>
13
13
#include < qtenvironmentvariables.h>
14
14
15
15
#include " logcat.hpp"
@@ -78,16 +78,10 @@ bool QmlToolingSupport::lockTooling() {
78
78
79
79
QString QmlToolingSupport::getQmllsConfig () {
80
80
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:" ); });
91
85
92
86
auto vfsPath = QsPaths::instance ()->shellVfsDir ()->path ();
93
87
auto importPathsStr = importPaths.join (u' :' );
You can’t perform that action at this time.
0 commit comments