History

threadsafe setRenderMethod

SamGondelman committed 7 years ago

Commit db813fa1 parent 451c52f2 files · +6 −7Browse files

Showing the changes to interface/src/scripting/RenderScriptingInterface.cpp (1 of 2 files). Show all

Unified · Split

interface/src/scripting/RenderScriptingInterface.cpp+5−0
@@ -24,6 +24,11 @@ QString RenderScriptingInterface::getRenderMethod() { · 23 unmodified lines
24}24}
25 25
26void RenderScriptingInterface::setRenderMethod(const QString& renderMethod) {26void RenderScriptingInterface::setRenderMethod(const QString& renderMethod) {
27 if (QThread::currentThread() != thread()) {
28 QMetaObject::invokeMethod(this, "setRenderMethod", Q_ARG(const QString&, renderMethod));
29 return;
30 }
31
27 auto config = dynamic_cast<task::SwitchConfig*>(qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.DeferredForwardSwitch"));32 auto config = dynamic_cast<task::SwitchConfig*>(qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.DeferredForwardSwitch"));
28 if (config) {33 if (config) {
29 if (renderMethod == DEFERRED) {34 if (renderMethod == DEFERRED) {