Files
nixpkgs/pkgs/development/libraries/qt-5/5.15/qtdeclarative-qml-paths.patch
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

34 lines
1.4 KiB
Diff

diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 289f11d006..9b0a48c6c7 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -1897,17 +1897,22 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e)
addImportPath(installImportsPath);
// env import paths
- if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QML2_IMPORT_PATH"))) {
- const QString envImportPath = qEnvironmentVariable("QML2_IMPORT_PATH");
+ auto addEnvImportPath = [this](const char *var) {
#if defined(Q_OS_WIN)
QLatin1Char pathSep(';');
#else
QLatin1Char pathSep(':');
#endif
- QStringList paths = envImportPath.split(pathSep, Qt::SkipEmptyParts);
- for (int ii = paths.count() - 1; ii >= 0; --ii)
- addImportPath(paths.at(ii));
- }
+ if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty(var))) {
+ const QString envImportPath = qEnvironmentVariable(var);
+ QStringList paths = envImportPath.split(pathSep, Qt::SkipEmptyParts);
+ for (int ii = paths.count() - 1; ii >= 0; --ii)
+ addImportPath(paths.at(ii));
+ }
+ };
+
+ addEnvImportPath("QML2_IMPORT_PATH");
+ addEnvImportPath("NIXPKGS_QT5_QML_IMPORT_PATH");
addImportPath(QStringLiteral("qrc:/qt-project.org/imports"));
addImportPath(QCoreApplication::applicationDirPath());