mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 11:37:58 +02:00
Merge pull request #12257 from jherico/source_tree_qml
Fix resource loading from source tree
This commit is contained in:
commit
00538c69cd
1 changed files with 11 additions and 5 deletions
|
@ -29,7 +29,6 @@
|
||||||
#include <mach-o/dyld.h>
|
#include <mach-o/dyld.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include "shared/GlobalAppProperties.h"
|
#include "shared/GlobalAppProperties.h"
|
||||||
#include "SharedUtil.h"
|
#include "SharedUtil.h"
|
||||||
|
|
||||||
|
@ -41,8 +40,15 @@ QString TEMP_DIR_FORMAT { "%1-%2-%3" };
|
||||||
#if defined(Q_OS_OSX)
|
#if defined(Q_OS_OSX)
|
||||||
static bool USE_SOURCE_TREE_RESOURCES = true;
|
static bool USE_SOURCE_TREE_RESOURCES = true;
|
||||||
#else
|
#else
|
||||||
static const QString USE_SOURCE_TREE_RESOURCES_FLAG("HIFI_USE_SOURCE_TREE_RESOURCES");
|
static bool USE_SOURCE_TREE_RESOURCES() {
|
||||||
static bool USE_SOURCE_TREE_RESOURCES = QProcessEnvironment::systemEnvironment().contains(USE_SOURCE_TREE_RESOURCES_FLAG);
|
static bool result = false;
|
||||||
|
static std::once_flag once;
|
||||||
|
std::call_once(once, [&] {
|
||||||
|
const QString USE_SOURCE_TREE_RESOURCES_FLAG("HIFI_USE_SOURCE_TREE_RESOURCES");
|
||||||
|
result = QProcessEnvironment::systemEnvironment().contains(USE_SOURCE_TREE_RESOURCES_FLAG);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -77,7 +83,7 @@ const QString& PathUtils::resourcesPath() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(Q_OS_ANDROID) && defined(DEV_BUILD)
|
#if !defined(Q_OS_ANDROID) && defined(DEV_BUILD)
|
||||||
if (USE_SOURCE_TREE_RESOURCES) {
|
if (USE_SOURCE_TREE_RESOURCES()) {
|
||||||
// For dev builds, optionally load content from the Git source tree
|
// For dev builds, optionally load content from the Git source tree
|
||||||
staticResourcePath = projectRootPath() + "/interface/resources/";
|
staticResourcePath = projectRootPath() + "/interface/resources/";
|
||||||
}
|
}
|
||||||
|
@ -100,7 +106,7 @@ const QString& PathUtils::resourcesUrl() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(Q_OS_ANDROID) && defined(DEV_BUILD)
|
#if !defined(Q_OS_ANDROID) && defined(DEV_BUILD)
|
||||||
if (USE_SOURCE_TREE_RESOURCES) {
|
if (USE_SOURCE_TREE_RESOURCES()) {
|
||||||
// For dev builds, optionally load content from the Git source tree
|
// For dev builds, optionally load content from the Git source tree
|
||||||
staticResourcePath = QUrl::fromLocalFile(projectRootPath() + "/interface/resources/").toString();
|
staticResourcePath = QUrl::fromLocalFile(projectRootPath() + "/interface/resources/").toString();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue