Showing the changes to libraries/script-engine/src/ScriptManager.cpp (1 of 7 files). Show all
Unified · Split
| @@ -1118,7 +1118,7 @@ void ScriptManager::timerFired() { · 1117 unmodified lines | |||
| 1118 | 1118 | ||
| 1119 | _timerCallCounter++; | 1119 | _timerCallCounter++; |
| 1120 | if (_timerCallCounter % 100 == 0) { | 1120 | if (_timerCallCounter % 100 == 0) { |
| 1121 | qDebug() << "Script engine: " << _engine->manager()->getFilename() | 1121 | qCDebug(scriptengine) << "Script engine: " << _engine->manager()->getFilename() |
| 1122 | << "timer call count: " << _timerCallCounter << " total time: " << _totalTimeInTimerEvents_s; | 1122 | << "timer call count: " << _timerCallCounter << " total time: " << _totalTimeInTimerEvents_s; |
| 1123 | } | 1123 | } |
| 1124 | QElapsedTimer callTimer; | 1124 | QElapsedTimer callTimer; |
| @@ -1201,7 +1201,7 @@ void ScriptManager::stopTimer(QTimer *timer) { · 76 unmodified lines | |||
| 1201 | } | 1201 | } |
| 1202 | 1202 | ||
| 1203 | QUrl ScriptManager::resolvePath(const QString& include) const { | 1203 | QUrl ScriptManager::resolvePath(const QString& include) const { |
| 1204 | //qDebug(scriptengine) << "ScriptManager::resolvePath: getCurrentScriptURLs: " << _engine->getCurrentScriptURLs(); | 1204 | //qCDebug(scriptengine) << "ScriptManager::resolvePath: getCurrentScriptURLs: " << _engine->getCurrentScriptURLs(); |
| 1205 | QUrl url(include); | 1205 | QUrl url(include); |
| 1206 | // first lets check to see if it's already a full URL -- or a Windows path like "c:/" | 1206 | // first lets check to see if it's already a full URL -- or a Windows path like "c:/" |
| 1207 | if (include.startsWith("/") || url.scheme().length() == 1) { | 1207 | if (include.startsWith("/") || url.scheme().length() == 1) { |
| @@ -1219,7 +1219,7 @@ QUrl ScriptManager::resolvePath(const QString& include) const { · 11 unmodified lines | |||
| 1219 | do { | 1219 | do { |
| 1220 | auto contextInfo = context->functionContext(); | 1220 | auto contextInfo = context->functionContext(); |
| 1221 | parentURL = QUrl(contextInfo->fileName()); | 1221 | parentURL = QUrl(contextInfo->fileName()); |
| 1222 | //qDebug(scriptengine) << "ScriptManager::resolvePath: URL get: " << parentURL << " backtrace: " << context->backtrace() << " " << _engine->getCurrentScriptURLs(); | 1222 | //qCDebug(scriptengine) << "ScriptManager::resolvePath: URL get: " << parentURL << " backtrace: " << context->backtrace() << " " << _engine->getCurrentScriptURLs(); |
| 1223 | parentContext = context->parentContext(); | 1223 | parentContext = context->parentContext(); |
| 1224 | context = parentContext.get(); | 1224 | context = parentContext.get(); |
| 1225 | } while (parentURL.isRelative() && context); | 1225 | } while (parentURL.isRelative() && context); |
| @@ -1420,7 +1420,7 @@ ScriptValue ScriptManager::newModule(const QString& modulePath, const ScriptValu · 194 unmodified lines | |||
| 1420 | // module.require is a bound version of require that always resolves relative to that module's path | 1420 | // module.require is a bound version of require that always resolves relative to that module's path |
| 1421 | auto boundRequire = _engine->evaluate("(function(id) { return Script.require(Script.require.resolve(id, this.filename)); })", "(boundRequire)"); | 1421 | auto boundRequire = _engine->evaluate("(function(id) { return Script.require(Script.require.resolve(id, this.filename)); })", "(boundRequire)"); |
| 1422 | module.setProperty("require", boundRequire, READONLY_PROP_FLAGS); | 1422 | module.setProperty("require", boundRequire, READONLY_PROP_FLAGS); |
| 1423 | //qDebug() << "Module object contents" << _engine->scriptValueDebugListMembers(module); | 1423 | //qCDebug(scriptengine) << "Module object contents" << _engine->scriptValueDebugListMembers(module); |
| 1424 | return module; | 1424 | return module; |
| 1425 | } | 1425 | } |
| 1426 | 1426 | ||
| @@ -1818,12 +1818,12 @@ QVariant ScriptManager::cloneEntityScriptDetails(const EntityItemID& entityID) { · 391 unmodified lines | |||
| 1818 | map["errorInfo"] = "Error: getEntityScriptDetails -- invalid entityID"; | 1818 | map["errorInfo"] = "Error: getEntityScriptDetails -- invalid entityID"; |
| 1819 | } else { | 1819 | } else { |
| 1820 | #ifdef DEBUG_ENTITY_STATES | 1820 | #ifdef DEBUG_ENTITY_STATES |
| 1821 | qDebug() << "cloneEntityScriptDetails" << entityID << QThread::currentThread(); | 1821 | qCDebug(scriptengine) << "cloneEntityScriptDetails" << entityID << QThread::currentThread(); |
| 1822 | #endif | 1822 | #endif |
| 1823 | EntityScriptDetails scriptDetails; | 1823 | EntityScriptDetails scriptDetails; |
| 1824 | if (getEntityScriptDetails(entityID, scriptDetails)) { | 1824 | if (getEntityScriptDetails(entityID, scriptDetails)) { |
| 1825 | #ifdef DEBUG_ENTITY_STATES | 1825 | #ifdef DEBUG_ENTITY_STATES |
| 1826 | qDebug() << "gotEntityScriptDetails" << scriptDetails.status << QThread::currentThread(); | 1826 | qCDebug(scriptengine) << "gotEntityScriptDetails" << scriptDetails.status << QThread::currentThread(); |
| 1827 | #endif | 1827 | #endif |
| 1828 | map["isRunning"] = isEntityScriptRunning(entityID); | 1828 | map["isRunning"] = isEntityScriptRunning(entityID); |
| 1829 | map["status"] = EntityScriptStatus_::valueToKey(scriptDetails.status).toLower(); | 1829 | map["status"] = EntityScriptStatus_::valueToKey(scriptDetails.status).toLower(); |
| @@ -1841,7 +1841,7 @@ QVariant ScriptManager::cloneEntityScriptDetails(const EntityItemID& entityID) { · 11 unmodified lines | |||
| 1841 | #endif | 1841 | #endif |
| 1842 | } else { | 1842 | } else { |
| 1843 | #ifdef DEBUG_ENTITY_STATES | 1843 | #ifdef DEBUG_ENTITY_STATES |
| 1844 | qDebug() << "!gotEntityScriptDetails" << QThread::currentThread(); | 1844 | qCDebug(scriptengine) << "!gotEntityScriptDetails" << QThread::currentThread(); |
| 1845 | #endif | 1845 | #endif |
| 1846 | map["isError"] = true; | 1846 | map["isError"] = true; |
| 1847 | map["errorInfo"] = "Entity script details unavailable"; | 1847 | map["errorInfo"] = "Entity script details unavailable"; |
| @@ -2130,7 +2130,7 @@ void ScriptManager::entityScriptContentAvailable(const EntityItemID& entityID, c · 282 unmodified lines | |||
| 2130 | } | 2130 | } |
| 2131 | // ENTITY SCRIPT WHITELIST ENDS HERE, uncomment below for original full disabling. | 2131 | // ENTITY SCRIPT WHITELIST ENDS HERE, uncomment below for original full disabling. |
| 2132 | 2132 | ||
| 2133 | // qDebug() << "(disabled entity script)" << entityID.toString() << scriptOrURL; | 2133 | // qCDebug(scriptengine) << "(disabled entity script)" << entityID.toString() << scriptOrURL; |
| 2134 | // exception = makeError("UNSAFE_ENTITY_SCRIPTS == 0"); | 2134 | // exception = makeError("UNSAFE_ENTITY_SCRIPTS == 0"); |
| 2135 | } | 2135 | } |
| 2136 | 2136 | ||
| @@ -2421,7 +2421,7 @@ void ScriptManager::callEntityScriptMethod(const EntityItemID& entityID, const Q · 284 unmodified lines | |||
| 2421 | } | 2421 | } |
| 2422 | } | 2422 | } |
| 2423 | if (!callAllowed) { | 2423 | if (!callAllowed) { |
| 2424 | qDebug() << "Method [" << methodName << "] not remotely callable."; | 2424 | qCDebug(scriptengine) << "Method [" << methodName << "] not remotely callable."; |
| 2425 | } | 2425 | } |
| 2426 | } | 2426 | } |
| 2427 | 2427 | ||