mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
works on windows now
This commit is contained in:
parent
3aa1090ced
commit
0c72ca1be3
3 changed files with 11 additions and 12 deletions
|
@ -216,7 +216,7 @@ QVariantList ScriptEngines::getRunning() {
|
|||
static const QString SETTINGS_KEY = "Settings";
|
||||
|
||||
void ScriptEngines::loadDefaultScripts() {
|
||||
loadScript(defaultScriptsLocation() + "/defaultScripts.js");
|
||||
loadScript(defaultScriptsLocation() + "/scripts/defaultScripts.js");
|
||||
}
|
||||
|
||||
void ScriptEngines::loadOneScript(const QString& scriptFilename) {
|
||||
|
|
|
@ -158,13 +158,13 @@ void ScriptsModel::requestDefaultFiles(QString marker) {
|
|||
QUrl url(defaultScriptsLocation());
|
||||
|
||||
if (url.isLocalFile()) {
|
||||
// QDirIterator it(url.toLocalFile(), QStringList() << "*.js", QDir::Files, QDirIterator::Subdirectories);
|
||||
// while (it.hasNext()) {
|
||||
// QString jsFile = it.next();;
|
||||
// _treeNodes.append(new TreeNodeScript(lastKey.mid(MODELS_LOCATION.length()),
|
||||
// defaultScriptsLocation() + "/" + jsFile,
|
||||
// SCRIPT_ORIGIN_DEFAULT));
|
||||
// }
|
||||
QString localDir = url.toLocalFile() + "/scripts";
|
||||
QDirIterator it(localDir, QStringList() << "*.js", QDir::Files, QDirIterator::Subdirectories);
|
||||
while (it.hasNext()) {
|
||||
QString jsFullPath = it.next();
|
||||
QString jsPartialPath = jsFullPath.mid(localDir.length() + 1); // + 1 to skip a separator
|
||||
_treeNodes.append(new TreeNodeScript(jsPartialPath, jsFullPath, SCRIPT_ORIGIN_DEFAULT));
|
||||
}
|
||||
} else {
|
||||
QUrlQuery query;
|
||||
query.addQueryItem(PREFIX_PARAMETER_NAME, MODELS_LOCATION);
|
||||
|
|
|
@ -56,11 +56,10 @@ QString findMostRecentFileExtension(const QString& originalFileName, QVector<QSt
|
|||
|
||||
QString defaultScriptsLocation() {
|
||||
#ifdef Q_OS_WIN
|
||||
// return "file:///" + QCoreApplication::applicationDirPath() + "/scripts";
|
||||
return "http://s3.amazonaws.com/hifi-public/scripts";
|
||||
return "file:///" + QCoreApplication::applicationDirPath();
|
||||
#elif defined(Q_OS_OSX)
|
||||
return "file:///" + QCoreApplication::applicationDirPath() + "/../../scripts";
|
||||
return "file:///" + QCoreApplication::applicationDirPath() + "/../..";
|
||||
#else
|
||||
return "http://s3.amazonaws.com/hifi-public/scripts";
|
||||
return "http://s3.amazonaws.com/hifi-public";
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue