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>
This commit is contained in:
@@ -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() == ".") {
|
||||
|
@@ -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() == ".") {
|
||||
|
Reference in New Issue
Block a user