mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 23:43:18 +02:00
on windows and osx use default scripts bundled with interface
This commit is contained in:
parent
473b7ff6d7
commit
de8153bd75
4 changed files with 17 additions and 4 deletions
|
@ -13,13 +13,14 @@
|
|||
|
||||
#include <SettingHandle.h>
|
||||
#include <UserActivityLogger.h>
|
||||
#include <PathUtils.h>
|
||||
|
||||
#include "ScriptEngine.h"
|
||||
#include "ScriptEngineLogging.h"
|
||||
|
||||
#define __STR2__(x) #x
|
||||
#define __STR1__(x) __STR2__(x)
|
||||
#define __LOC__ __FILE__ "("__STR1__(__LINE__)") : Warning Msg: "
|
||||
#define __LOC__ __FILE__ "(" __STR1__(__LINE__) ") : Warning Msg: "
|
||||
|
||||
#ifndef __APPLE__
|
||||
static const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
|
||||
|
@ -213,10 +214,9 @@ QVariantList ScriptEngines::getRunning() {
|
|||
|
||||
|
||||
static const QString SETTINGS_KEY = "Settings";
|
||||
static const QString DEFAULT_SCRIPTS_JS_URL = "http://s3.amazonaws.com/hifi-public/scripts/defaultScripts.js";
|
||||
|
||||
void ScriptEngines::loadDefaultScripts() {
|
||||
loadScript(DEFAULT_SCRIPTS_JS_URL);
|
||||
loadScript(defaultScriptsFileName());
|
||||
}
|
||||
|
||||
void ScriptEngines::loadOneScript(const QString& scriptFilename) {
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "ScriptEngineLogging.h"
|
||||
#define __STR2__(x) #x
|
||||
#define __STR1__(x) __STR2__(x)
|
||||
#define __LOC__ __FILE__ "("__STR1__(__LINE__)") : Warning Msg: "
|
||||
#define __LOC__ __FILE__ "(" __STR1__(__LINE__) ") : Warning Msg: "
|
||||
|
||||
|
||||
static const QString S3_URL = "http://s3.amazonaws.com/hifi-public";
|
||||
|
|
|
@ -53,3 +53,14 @@ QString findMostRecentFileExtension(const QString& originalFileName, QVector<QSt
|
|||
}
|
||||
return newestFileName;
|
||||
}
|
||||
|
||||
QString defaultScriptsFileName() {
|
||||
#ifdef Q_OS_WIN
|
||||
return QCoreApplication::applicationDirPath() + "/scripts/";
|
||||
#elif defined(Q_OS_OSX)
|
||||
return QCoreApplication::applicationDirPath() + "/../../scripts/";
|
||||
#else
|
||||
static const QString DEFAULT_SCRIPTS_JS_URL = "http://s3.amazonaws.com/hifi-public/scripts/defaultScripts.js";
|
||||
return DEFAULT_SCRIPTS_JS_URL;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -27,4 +27,6 @@ public:
|
|||
QString fileNameWithoutExtension(const QString& fileName, const QVector<QString> possibleExtensions);
|
||||
QString findMostRecentFileExtension(const QString& originalFileName, QVector<QString> possibleExtensions);
|
||||
|
||||
QString defaultScriptsFileName();
|
||||
|
||||
#endif // hifi_PathUtils_h
|
||||
|
|
Loading…
Reference in a new issue