mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 17:04:10 +02:00
Fix resource loading from source tree
This commit is contained in:
parent
e3f859329d
commit
3915a2d4ba
1 changed files with 11 additions and 5 deletions
|
@ -29,7 +29,6 @@
|
|||
#include <mach-o/dyld.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "shared/GlobalAppProperties.h"
|
||||
#include "SharedUtil.h"
|
||||
|
||||
|
@ -41,8 +40,15 @@ QString TEMP_DIR_FORMAT { "%1-%2-%3" };
|
|||
#if defined(Q_OS_OSX)
|
||||
static bool USE_SOURCE_TREE_RESOURCES = true;
|
||||
#else
|
||||
static const QString USE_SOURCE_TREE_RESOURCES_FLAG("HIFI_USE_SOURCE_TREE_RESOURCES");
|
||||
static bool USE_SOURCE_TREE_RESOURCES = QProcessEnvironment::systemEnvironment().contains(USE_SOURCE_TREE_RESOURCES_FLAG);
|
||||
static bool USE_SOURCE_TREE_RESOURCES() {
|
||||
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
|
||||
|
||||
|
@ -77,7 +83,7 @@ const QString& PathUtils::resourcesPath() {
|
|||
#endif
|
||||
|
||||
#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
|
||||
staticResourcePath = projectRootPath() + "/interface/resources/";
|
||||
}
|
||||
|
@ -100,7 +106,7 @@ const QString& PathUtils::resourcesUrl() {
|
|||
#endif
|
||||
|
||||
#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
|
||||
staticResourcePath = QUrl::fromLocalFile(projectRootPath() + "/interface/resources/").toString();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue