aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@qt.io>2023-03-06 10:46:05 +0100
committerTim Jenssen <tim.jenssen@qt.io>2023-03-06 10:08:10 +0000
commitd29ca4322fe338a46457a37860707060556bcbbc (patch)
tree66219ea5580e38a4531e3c47f67a71cf8d8cc9ab
parent303b5342732f50ad80fca94ed4e732a36f9951ce (diff)
QmlDesigner: adjust content library paths in .app bundles
Change-Id: I7109b25097d061dbbbc8828273b5d0acfe94bf3c Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> (cherry picked from commit eb16c66552e3e0b9961c15ee7f851282c9fbdf80)
-rw-r--r--src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp12
-rw-r--r--src/plugins/qmldesigner/components/contentlibrary/contentlibrarywidget.cpp8
2 files changed, 16 insertions, 4 deletions
diff --git a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp
index 2acc449978..be2900008b 100644
--- a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp
+++ b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp
@@ -9,8 +9,9 @@
#include "contentlibrarywidget.h"
#include "qmldesignerconstants.h"
-#include "utils/algorithm.h"
-#include "utils/qtcassert.h"
+#include <utils/algorithm.h>
+#include <utils/hostosinfo.h>
+#include <utils/qtcassert.h>
#include <QCoreApplication>
#include <QJsonArray>
@@ -95,7 +96,12 @@ void ContentLibraryMaterialsModel::loadMaterialBundle()
if (m_matBundleExists || m_probeMatBundleDir)
return;
- QDir matBundleDir(qEnvironmentVariable("MATERIAL_BUNDLE_PATH"));
+ QDir matBundleDir;
+
+ if (!qEnvironmentVariable("MATERIAL_BUNDLE_PATH").isEmpty())
+ matBundleDir.setPath(qEnvironmentVariable("MATERIAL_BUNDLE_PATH"));
+ else if (Utils::HostOsInfo::isMacHost())
+ matBundleDir.setPath(QCoreApplication::applicationDirPath() + "/../Resources/material_bundle");
// search for matBundleDir from exec dir and up
if (matBundleDir.dirName() == ".") {
diff --git a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarywidget.cpp b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarywidget.cpp
index 07f385e304..0b0a2b76a2 100644
--- a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarywidget.cpp
+++ b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarywidget.cpp
@@ -15,6 +15,7 @@
#include <theme.h>
#include <utils/algorithm.h>
+#include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
#include <QMimeData>
@@ -229,7 +230,12 @@ void ContentLibraryWidget::setIsDragging(bool val)
QString ContentLibraryWidget::findTextureBundlePath()
{
- QDir texBundleDir(qEnvironmentVariable("TEXTURE_BUNDLE_PATH"));
+ QDir texBundleDir;
+
+ if (!qEnvironmentVariable("TEXTURE_BUNDLE_PATH").isEmpty())
+ texBundleDir.setPath(qEnvironmentVariable("TEXTURE_BUNDLE_PATH"));
+ else if (Utils::HostOsInfo::isMacHost())
+ texBundleDir.setPath(QCoreApplication::applicationDirPath() + "/../Resources/texture_bundle");
// search for matBundleDir from exec dir and up
if (texBundleDir.dirName() == ".") {