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
350350
351351 std::weak_ptr<ScriptManager> weakScriptManager = _scriptManager;
352352 auto consoleFileName = _consoleFileName;
353− QFuture<QVariant> future = QtConcurrent::run([weakScriptManager, consoleFileName, command]() -> QVariant {
354− QVariant result;
353+ QFuture<QString> future = QtConcurrent::run([weakScriptManager, consoleFileName, command]() -> QString {
354+ QString result;
355355 auto scriptManager = weakScriptManager.lock();
356356 if (scriptManager) {
357357 BLOCKING_INVOKE_METHOD(scriptManager.get(), [&scriptManager, &consoleFileName, &command, &result]() -> void {
358− result = scriptManager->evaluate(command, consoleFileName).toVariant();
358+ result = scriptManager->evaluate(command, consoleFileName).repr();
359359 });
360360 }
361361 return result;
@@ -364,7 +364,7 @@ void JSConsole::executeCommand(const QString& command) { · 2 unmodified lines
364364 }
365365
366366 void JSConsole::commandFinished() {
367− QVariant result = _executeWatcher.result();
367+ auto result = _executeWatcher.result();
368368
369369 _ui->promptTextEdit->setDisabled(false);
370370
@@ -378,7 +378,7 @@ void JSConsole::commandFinished() { · 7 unmodified lines
378378
379379 QColor color = _lightTheme ? QColorConstants::Svg::gray : QColorConstants::Svg::darkgray;
380380
381− appendMessage("<", result.toString(), color);
381+ appendMessage("<", result, color);
382382
383383 resetCurrentCommandHistory();
384384 }