History

Hide script stop behind accessor and fix friendship

Zach Pomerantz committed 10 years ago

Commit 36565591 parent 59e4b9c4 files · +19 −13Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 4 files). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+7−7
@@ -754,7 +754,7 @@ void ScriptEngine::addEventHandler(const EntityItemID& entityID, const QString& · 753 unmodified lines
754754
755755
756756 QScriptValue ScriptEngine::evaluate(const QString& sourceCode, const QString& fileName, int lineNumber) {
757− if (DependencyManager::get<ScriptEngines>()->_stopped) {
757+ if (DependencyManager::get<ScriptEngines>()->isStopped()) {
758758 return QScriptValue(); // bail early
759759 }
760760
@@ -790,7 +790,7 @@ QScriptValue ScriptEngine::evaluate(const QString& sourceCode, const QString& fi · 29 unmodified lines
790790 }
791791
792792 void ScriptEngine::run() {
793− if (DependencyManager::get<ScriptEngines>()->_stopped) {
793+ if (DependencyManager::get<ScriptEngines>()->isStopped()) {
794794 return; // bail early - avoid setting state in init(), as evaluate() will bail too
795795 }
796796
@@ -1023,7 +1023,7 @@ QObject* ScriptEngine::setupTimerWithInterval(const QScriptValue& function, int · 226 unmodified lines
10231023 }
10241024
10251025 QObject* ScriptEngine::setInterval(const QScriptValue& function, int intervalMS) {
1026− if (DependencyManager::get<ScriptEngines>()->_stopped) {
1026+ if (DependencyManager::get<ScriptEngines>()->isStopped()) {
10271027 qCDebug(scriptengine) << "Script.setInterval() while shutting down is ignored... parent script:" << getFilename();
10281028 return NULL; // bail early
10291029 }
@@ -1032,7 +1032,7 @@ QObject* ScriptEngine::setInterval(const QScriptValue& function, int intervalMS) · 2 unmodified lines
10321032 }
10331033
10341034 QObject* ScriptEngine::setTimeout(const QScriptValue& function, int timeoutMS) {
1035− if (DependencyManager::get<ScriptEngines>()->_stopped) {
1035+ if (DependencyManager::get<ScriptEngines>()->isStopped()) {
10361036 qCDebug(scriptengine) << "Script.setTimeout() while shutting down is ignored... parent script:" << getFilename();
10371037 return NULL; // bail early
10381038 }
@@ -1084,7 +1084,7 @@ void ScriptEngine::print(const QString& message) { · 45 unmodified lines
10841084 // If no callback is specified, the included files will be loaded synchronously and will block execution until
10851085 // all of the files have finished loading.
10861086 void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callback) {
1087− if (DependencyManager::get<ScriptEngines>()->_stopped) {
1087+ if (DependencyManager::get<ScriptEngines>()->isStopped()) {
10881088 qCDebug(scriptengine) << "Script.include() while shutting down is ignored..."
10891089 << "includeFiles:" << includeFiles << "parent script:" << getFilename();
10901090 return; // bail early
@@ -1182,7 +1182,7 @@ void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callbac · 91 unmodified lines
11821182 }
11831183
11841184 void ScriptEngine::include(const QString& includeFile, QScriptValue callback) {
1185− if (DependencyManager::get<ScriptEngines>()->_stopped) {
1185+ if (DependencyManager::get<ScriptEngines>()->isStopped()) {
11861186 qCDebug(scriptengine) << "Script.include() while shutting down is ignored... "
11871187 << "includeFile:" << includeFile << "parent script:" << getFilename();
11881188 return; // bail early
@@ -1197,7 +1197,7 @@ void ScriptEngine::include(const QString& includeFile, QScriptValue callback) { · 8 unmodified lines
11971197 // as a stand-alone script. To accomplish this, the ScriptEngine class just emits a signal which
11981198 // the Application or other context will connect to in order to know to actually load the script
11991199 void ScriptEngine::load(const QString& loadFile) {
1200− if (DependencyManager::get<ScriptEngines>()->_stopped) {
1200+ if (DependencyManager::get<ScriptEngines>()->isStopped()) {
12011201 qCDebug(scriptengine) << "Script.load() while shutting down is ignored... "
12021202 << "loadFile:" << loadFile << "parent script:" << getFilename();
12031203 return; // bail early