History

cleanup spacing in ScriptEngine

Stephen Birarda committed 10 years ago

Commit b1a69bb1 parent 2acfbd02 files · +31 −27Browse files

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

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+30−26
@@ -65,9 +65,9 @@ static QScriptValue debugPrint(QScriptContext* context, QScriptEngine* engine){ · 64 unmodified lines
6565 qCDebug(scriptengine).noquote() << "script:print()<<" << message; // noquote() so that \n is treated as newline
6666
6767 message = message.replace("\\", "\\\\")
68− .replace("\n", "\\n")
69− .replace("\r", "\\r")
70− .replace("'", "\\'");
68+ .replace("\n", "\\n")
69+ .replace("\r", "\\r")
70+ .replace("'", "\\'");
7171 engine->evaluate("Script.print('" + message + "')");
7272
7373 return QScriptValue();
@@ -123,11 +123,11 @@ static bool hadUncaughtExceptions(QScriptEngine& engine, const QString& fileName · 49 unmodified lines
123123 }
124124
125125 ScriptEngine::ScriptEngine(const QString& scriptContents, const QString& fileNameString, bool wantSignals) :
126−_scriptContents(scriptContents),
127−_timerFunctionMap(),
128−_wantSignals(wantSignals),
129−_fileNameString(fileNameString),
130−_arrayBufferClass(new ArrayBufferClass(this))
126+ _scriptContents(scriptContents),
127+ _timerFunctionMap(),
128+ _wantSignals(wantSignals),
129+ _fileNameString(fileNameString),
130+ _arrayBufferClass(new ArrayBufferClass(this))
131131 {
132132 _allScriptsMutex.lock();
133133 _allKnownScriptEngines.insert(this);
@@ -495,7 +495,7 @@ void ScriptEngine::registerGetterSetter(const QString& name, QScriptEngine::Func · 361 unmodified lines
495495 if (QThread::currentThread() != thread()) {
496496 #ifdef THREAD_DEBUGGING
497497 qDebug() << "*** WARNING *** ScriptEngine::registerGetterSetter() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
498− " name:" << name << "parent:" << parent;
498+ " name:" << name << "parent:" << parent;
499499 #endif
500500 QMetaObject::invokeMethod(this, "registerGetterSetter",
501501 Q_ARG(const QString&, name),
@@ -528,7 +528,7 @@ void ScriptEngine::removeEventHandler(const EntityItemID& entityID, const QStrin · 26 unmodified lines
528528 if (QThread::currentThread() != thread()) {
529529 #ifdef THREAD_DEBUGGING
530530 qDebug() << "*** WARNING *** ScriptEngine::removeEventHandler() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
531− "entityID:" << entityID << " eventName:" << eventName;
531+ "entityID:" << entityID << " eventName:" << eventName;
532532 #endif
533533 QMetaObject::invokeMethod(this, "removeEventHandler",
534534 Q_ARG(const EntityItemID&, entityID),
@@ -955,7 +955,7 @@ void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callbac · 420 unmodified lines
955955 void ScriptEngine::include(const QString& includeFile, QScriptValue callback) {
956956 if (_stoppingAllScripts) {
957957 qCDebug(scriptengine) << "Script.include() while shutting down is ignored... "
958− << "includeFile:" << includeFile << "parent script:" << getFilename();
958+ << "includeFile:" << includeFile << "parent script:" << getFilename();
959959 return; // bail early
960960 }
961961
@@ -970,7 +970,7 @@ void ScriptEngine::include(const QString& includeFile, QScriptValue callback) { · 8 unmodified lines
970970 void ScriptEngine::load(const QString& loadFile) {
971971 if (_stoppingAllScripts) {
972972 qCDebug(scriptengine) << "Script.load() while shutting down is ignored... "
973− << "loadFile:" << loadFile << "parent script:" << getFilename();
973+ << "loadFile:" << loadFile << "parent script:" << getFilename();
974974 return; // bail early
975975 }
976976
@@ -1016,7 +1016,7 @@ void ScriptEngine::loadEntityScript(const EntityItemID& entityID, const QString& · 39 unmodified lines
10161016 if (QThread::currentThread() != thread()) {
10171017 #ifdef THREAD_DEBUGGING
10181018 qDebug() << "*** WARNING *** ScriptEngine::loadEntityScript() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
1019− "entityID:" << entityID << "entityScript:" << entityScript <<"forceRedownload:" << forceRedownload;
1019+ "entityID:" << entityID << "entityScript:" << entityScript <<"forceRedownload:" << forceRedownload;
10201020 #endif
10211021
10221022 QMetaObject::invokeMethod(this, "loadEntityScript",
@@ -1027,18 +1027,20 @@ void ScriptEngine::loadEntityScript(const EntityItemID& entityID, const QString& · 4 unmodified lines
10271027 }
10281028 #ifdef THREAD_DEBUGGING
10291029 qDebug() << "ScriptEngine::loadEntityScript() called on correct thread [" << thread() << "] "
1030− "entityID:" << entityID << "entityScript:" << entityScript << "forceRedownload:" << forceRedownload;
1030+ "entityID:" << entityID << "entityScript:" << entityScript << "forceRedownload:" << forceRedownload;
10311031 #endif
10321032
10331033 // If we've been called our known entityScripts should not know about us..
10341034 assert(!_entityScripts.contains(entityID));
10351035
10361036 #ifdef THREAD_DEBUGGING
1037− qDebug() << "ScriptEngine::loadEntityScript() calling scriptCache->getScriptContents() on thread [" << QThread::currentThread() << "] expected thread [" << thread() << "]";
1037+ qDebug() << "ScriptEngine::loadEntityScript() calling scriptCache->getScriptContents() on thread ["
1038+ << QThread::currentThread() << "] expected thread [" << thread() << "]";
10381039 #endif
10391040 DependencyManager::get<ScriptCache>()->getScriptContents(entityScript, [=](const QString& scriptOrURL, const QString& contents, bool isURL, bool success) {
10401041 #ifdef THREAD_DEBUGGING
1041− qDebug() << "ScriptEngine::entityScriptContentAvailable() IN LAMBDA contentAvailable on thread [" << QThread::currentThread() << "] expected thread [" << thread() << "]";
1042+ qDebug() << "ScriptEngine::entityScriptContentAvailable() IN LAMBDA contentAvailable on thread ["
1043+ << QThread::currentThread() << "] expected thread [" << thread() << "]";
10421044 #endif
10431045
10441046 this->entityScriptContentAvailable(entityID, scriptOrURL, contents, isURL, success);
@@ -1091,11 +1093,13 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 46 unmodified lines
10911093
10921094 if (!testConstructor.isFunction()) {
10931095 qCDebug(scriptengine) << "ScriptEngine::loadEntityScript() entity:" << entityID << "\n"
1094− " NOT CONSTRUCTOR\n"
1095− " SCRIPT:" << scriptOrURL;
1096+ " NOT CONSTRUCTOR\n"
1097+ " SCRIPT:" << scriptOrURL;
1098+
10961099 if (!isFileUrl) {
10971100 scriptCache->addScriptToBadScriptList(scriptOrURL);
10981101 }
1102+
10991103 return; // done processing script
11001104 }
11011105
@@ -1121,7 +1125,7 @@ void ScriptEngine::unloadEntityScript(const EntityItemID& entityID) { · 19 unmodified lines
11211125 if (QThread::currentThread() != thread()) {
11221126 #ifdef THREAD_DEBUGGING
11231127 qDebug() << "*** WARNING *** ScriptEngine::unloadEntityScript() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
1124− "entityID:" << entityID;
1128+ "entityID:" << entityID;
11251129 #endif
11261130
11271131 QMetaObject::invokeMethod(this, "unloadEntityScript",
@@ -1130,7 +1134,7 @@ void ScriptEngine::unloadEntityScript(const EntityItemID& entityID) { · 2 unmodified lines
11301134 }
11311135 #ifdef THREAD_DEBUGGING
11321136 qDebug() << "ScriptEngine::unloadEntityScript() called on correct thread [" << thread() << "] "
1133− "entityID:" << entityID;
1137+ "entityID:" << entityID;
11341138 #endif
11351139
11361140 if (_entityScripts.contains(entityID)) {
@@ -1195,7 +1199,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS · 58 unmodified lines
11951199 if (QThread::currentThread() != thread()) {
11961200 #ifdef THREAD_DEBUGGING
11971201 qDebug() << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
1198− "entityID:" << entityID << "methodName:" << methodName;
1202+ "entityID:" << entityID << "methodName:" << methodName;
11991203 #endif
12001204
12011205 QMetaObject::invokeMethod(this, "callEntityScriptMethod",
@@ -1206,7 +1210,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS · 4 unmodified lines
12061210 }
12071211 #ifdef THREAD_DEBUGGING
12081212 qDebug() << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] "
1209− "entityID:" << entityID << "methodName:" << methodName;
1213+ "entityID:" << entityID << "methodName:" << methodName;
12101214 #endif
12111215
12121216 refreshFileScript(entityID);
@@ -1227,7 +1231,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS · 14 unmodified lines
12271231 if (QThread::currentThread() != thread()) {
12281232 #ifdef THREAD_DEBUGGING
12291233 qDebug() << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
1230− "entityID:" << entityID << "methodName:" << methodName << "event: mouseEvent";
1234+ "entityID:" << entityID << "methodName:" << methodName << "event: mouseEvent";
12311235 #endif
12321236
12331237 QMetaObject::invokeMethod(this, "callEntityScriptMethod",
@@ -1238,7 +1242,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS · 4 unmodified lines
12381242 }
12391243 #ifdef THREAD_DEBUGGING
12401244 qDebug() << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] "
1241− "entityID:" << entityID << "methodName:" << methodName << "event: mouseEvent";
1245+ "entityID:" << entityID << "methodName:" << methodName << "event: mouseEvent";
12421246 #endif
12431247
12441248 refreshFileScript(entityID);
@@ -1259,7 +1263,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS · 14 unmodified lines
12591263 if (QThread::currentThread() != thread()) {
12601264 #ifdef THREAD_DEBUGGING
12611265 qDebug() << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
1262− "entityID:" << entityID << "methodName:" << methodName << "otherID:" << otherID << "collision: collision";
1266+ "entityID:" << entityID << "methodName:" << methodName << "otherID:" << otherID << "collision: collision";
12631267 #endif
12641268
12651269 QMetaObject::invokeMethod(this, "callEntityScriptMethod",
@@ -1271,7 +1275,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS · 5 unmodified lines
12711275 }
12721276 #ifdef THREAD_DEBUGGING
12731277 qDebug() << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] "
1274− "entityID:" << entityID << "methodName:" << methodName << "otherID:" << otherID << "collision: collision";
1278+ "entityID:" << entityID << "methodName:" << methodName << "otherID:" << otherID << "collision: collision";
12751279 #endif
12761280
12771281 refreshFileScript(entityID);