forked from qt-creator/qt-creator
QmlDesigner: adjust content library paths in .app bundles
Change-Id: I7109b25097d061dbbbc8828273b5d0acfe94bf3c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
(cherry picked from commit eb16c66552
)
This commit is contained in:
@@ -9,8 +9,9 @@
|
|||||||
#include "contentlibrarywidget.h"
|
#include "contentlibrarywidget.h"
|
||||||
#include "qmldesignerconstants.h"
|
#include "qmldesignerconstants.h"
|
||||||
|
|
||||||
#include "utils/algorithm.h"
|
#include <utils/algorithm.h>
|
||||||
#include "utils/qtcassert.h"
|
#include <utils/hostosinfo.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
@@ -95,7 +96,12 @@ void ContentLibraryMaterialsModel::loadMaterialBundle()
|
|||||||
if (m_matBundleExists || m_probeMatBundleDir)
|
if (m_matBundleExists || m_probeMatBundleDir)
|
||||||
return;
|
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
|
// search for matBundleDir from exec dir and up
|
||||||
if (matBundleDir.dirName() == ".") {
|
if (matBundleDir.dirName() == ".") {
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
#include <theme.h>
|
#include <theme.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
@@ -229,7 +230,12 @@ void ContentLibraryWidget::setIsDragging(bool val)
|
|||||||
|
|
||||||
QString ContentLibraryWidget::findTextureBundlePath()
|
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
|
// search for matBundleDir from exec dir and up
|
||||||
if (texBundleDir.dirName() == ".") {
|
if (texBundleDir.dirName() == ".") {
|
||||||
|
Reference in New Issue
Block a user