2017-10-24 04:39:54 -07:00
|
|
|
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
|
|
|
|
index dfdf2edbe..7ee96049d 100644
|
|
|
|
--- a/src/qml/qml/qqmlimport.cpp
|
|
|
|
+++ b/src/qml/qml/qqmlimport.cpp
|
|
|
|
@@ -1568,6 +1568,15 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e)
|
2017-02-28 07:37:57 -08:00
|
|
|
QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
|
|
|
|
addImportPath(installImportsPath);
|
|
|
|
|
2017-06-15 05:58:55 -07:00
|
|
|
+ // Add import paths derived from PATH
|
|
|
|
+ const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':');
|
|
|
|
+ const QString qmldir = QStringLiteral("../" NIXPKGS_QML2_IMPORT_PREFIX);
|
|
|
|
+ for (const QString &path: paths) {
|
|
|
|
+ if (!path.isEmpty()) {
|
|
|
|
+ addImportPath(QDir::cleanPath(path + QDir::separator() + qmldir));
|
2017-02-28 07:37:57 -08:00
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
// env import paths
|
2017-05-15 04:44:33 -07:00
|
|
|
if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QML2_IMPORT_PATH"))) {
|
|
|
|
const QByteArray envImportPath = qgetenv("QML2_IMPORT_PATH");
|