Showing the changes to libraries/script-engine/src/qtscript/ScriptEngineQtScript.cpp (1 of 5 files). Show all
Unified · Split
| @@ -354,37 +354,10 @@ ScriptEngineQtScript::ScriptEngineQtScript(ScriptManager* scriptManager) : · 353 unmodified lines | ||
| 354 | 354 | setAgent(_contextAgent); |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | −bool ScriptEngineQtScript::isDebugMode() const { | |
| 358 | −#if defined(DEBUG) | |
| 359 | − return true; | |
| 360 | −#else | |
| 361 | − return false; | |
| 362 | −#endif | |
| 363 | −} | |
| 364 | − | |
| 365 | 357 | ScriptEngineQtScript::~ScriptEngineQtScript() { |
| 366 | 358 | delete _contextAgent; |
| 367 | 359 | } |
| 368 | 360 | |
| 369 | −void ScriptEngineQtScript::disconnectNonEssentialSignals() { | |
| 370 | − disconnect(); | |
| 371 | − QThread* workerThread; | |
| 372 | − // Ensure the thread should be running, and does exist | |
| 373 | − if (_isRunning && _isThreaded && (workerThread = QScriptEngine::thread())) { | |
| 374 | − connect(this, &QObject::destroyed, workerThread, &QThread::quit); | |
| 375 | − connect(workerThread, &QThread::finished, workerThread, &QObject::deleteLater); | |
| 376 | − } | |
| 377 | −} | |
| 378 | − | |
| 379 | −void ScriptEngineQtScript::executeOnScriptThread(std::function<void()> function, const Qt::ConnectionType& type ) { | |
| 380 | − if (QThread::currentThread() != QScriptEngine::thread()) { | |
| 381 | − QMetaObject::invokeMethod(this, "executeOnScriptThread", type, Q_ARG(std::function<void()>, function)); | |
| 382 | − return; | |
| 383 | − } | |
| 384 | − | |
| 385 | − function(); | |
| 386 | −} | |
| 387 | − | |
| 388 | 361 | void ScriptEngineQtScript::registerEnum(const QString& enumName, QMetaEnum newEnum) { |
| 389 | 362 | if (!newEnum.isValid()) { |
| 390 | 363 | qCCritical(scriptengine) << "registerEnum called on invalid enum with name " << enumName; |
| @@ -768,16 +741,6 @@ void ScriptEngineQtScript::updateMemoryCost(const qint64& deltaSize) { · 377 unmodified lines | ||
| 768 | 741 | } |
| 769 | 742 | } |
| 770 | 743 | |
| 771 | −void ScriptEngineQtScript::print(const QString& message) { | |
| 772 | − QString filename; | |
| 773 | − auto scriptManager = manager(); | |
| 774 | − if (scriptManager) { | |
| 775 | − filename = scriptManager->getFilename(); | |
| 776 | − } | |
| 777 | − | |
| 778 | − emit printedMessage(message, filename); | |
| 779 | −} | |
| 780 | − | |
| 781 | 744 | |
| 782 | 745 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 783 | 746 | // ScriptEngine implementation |