History

ScriptValue::repr, detailed representation of a script value for logging

Ada committed 8 months ago

Commit abd6bae1 parent cdb75078 files · +143 −8Browse files

Showing the changes to interface/src/ui/JSConsole.cpp (1 of 8 files). Show all

Unified · Split

interface/src/ui/JSConsole.cpp+5−5
@@ -350,12 +350,12 @@ void JSConsole::executeCommand(const QString& command) { · 349 unmodified lines
350 350
351 std::weak_ptr<ScriptManager> weakScriptManager = _scriptManager;351 std::weak_ptr<ScriptManager> weakScriptManager = _scriptManager;
352 auto consoleFileName = _consoleFileName;352 auto consoleFileName = _consoleFileName;
353 QFuture<QVariant> future = QtConcurrent::run([weakScriptManager, consoleFileName, command]() -> QVariant {353 QFuture<QString> future = QtConcurrent::run([weakScriptManager, consoleFileName, command]() -> QString {
354 QVariant result;354 QString result;
355 auto scriptManager = weakScriptManager.lock();355 auto scriptManager = weakScriptManager.lock();
356 if (scriptManager) {356 if (scriptManager) {
357 BLOCKING_INVOKE_METHOD(scriptManager.get(), [&scriptManager, &consoleFileName, &command, &result]() -> void {357 BLOCKING_INVOKE_METHOD(scriptManager.get(), [&scriptManager, &consoleFileName, &command, &result]() -> void {
358 result = scriptManager->evaluate(command, consoleFileName).toVariant();358 result = scriptManager->evaluate(command, consoleFileName).repr();
359 });359 });
360 }360 }
361 return result;361 return result;
@@ -364,7 +364,7 @@ void JSConsole::executeCommand(const QString& command) { · 2 unmodified lines
364}364}
365 365
366void JSConsole::commandFinished() {366void JSConsole::commandFinished() {
367 QVariant result = _executeWatcher.result();367 auto result = _executeWatcher.result();
368 368
369 _ui->promptTextEdit->setDisabled(false);369 _ui->promptTextEdit->setDisabled(false);
370 370
@@ -378,7 +378,7 @@ void JSConsole::commandFinished() { · 7 unmodified lines
378 378
379 QColor color = _lightTheme ? QColorConstants::Svg::gray : QColorConstants::Svg::darkgray;379 QColor color = _lightTheme ? QColorConstants::Svg::gray : QColorConstants::Svg::darkgray;
380 380
381 appendMessage("<", result.toString(), color);381 appendMessage("<", result, color);
382 382
383 resetCurrentCommandHistory();383 resetCurrentCommandHistory();
384}384}