History

update script engine to not treat about:* as a local filename; resolve debugPrint FIXME

humbletim committed 9 years ago

Commit e765d881 parent 8cea7f63 files · +13 −6Browse files

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

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+9−4
@@ -105,11 +105,11 @@ static QScriptValue debugPrint(QScriptContext* context, QScriptEngine* engine) { · 104 unmodified lines
105 }105 }
106 message += context->argument(i).toString();106 message += context->argument(i).toString();
107 }107 }
108 qCDebug(scriptengineScript).noquote() << "script:print()<<" << message; // noquote() so that \n is treated as newline108 qCDebug(scriptengineScript).noquote() << message; // noquote() so that \n is treated as newline
109 109
110 // FIXME - this approach neeeds revisiting. print() comes here, which ends up calling Script.print?110 if (ScriptEngine *scriptEngine = qobject_cast<ScriptEngine*>(engine)) {
111 engine->globalObject().property("Script").property("print")111 scriptEngine->print(message);
112 .call(engine->nullValue(), QScriptValueList({ message }));112 }
113 113
114 return QScriptValue();114 return QScriptValue();
115}115}
@@ -472,6 +472,11 @@ void ScriptEngine::scriptInfoMessage(const QString& message) { · 356 unmodified lines
472 emit infoMessage(message, getFilename());472 emit infoMessage(message, getFilename());
473}473}
474 474
475void ScriptEngine::scriptPrintedMessage(const QString& message) {
476 qCDebug(scriptengine) << message;
477 emit printedMessage(message, getFilename());
478}
479
475// Even though we never pass AnimVariantMap directly to and from javascript, the queued invokeMethod of480// Even though we never pass AnimVariantMap directly to and from javascript, the queued invokeMethod of
476// callAnimationStateHandler requires that the type be registered.481// callAnimationStateHandler requires that the type be registered.
477// These two are meaningful, if we ever do want to use them...482// These two are meaningful, if we ever do want to use them...