History

Merging with master

samcake committed 8 years ago

Commit 33bbbce2 parents f50b2fa da154d331 files · +361 −141Browse files

Showing the changes to interface/src/Application.cpp (1 of 31 files). Show all

Unified · Split

interface/src/Application.cpp+11−2
@@ -4753,7 +4753,7 @@ void Application::updateLOD(float deltaTime) const { · 4752 unmodified lines
47534753 }
47544754 }
47554755
4756−void Application::pushPostUpdateLambda(void* key, std::function<void()> func) {
4756+void Application::pushPostUpdateLambda(void* key, const std::function<void()>& func) {
47574757 std::unique_lock<std::mutex> guard(_postUpdateLambdasLock);
47584758 _postUpdateLambdas[key] = func;
47594759 }
@@ -7377,7 +7377,7 @@ void Application::windowMinimizedChanged(bool minimized) { · 2617 unmodified lines
73777377 }
73787378 }
73797379
7380−void Application::postLambdaEvent(std::function<void()> f) {
7380+void Application::postLambdaEvent(const std::function<void()>& f) {
73817381 if (this->thread() == QThread::currentThread()) {
73827382 f();
73837383 } else {
@@ -7385,6 +7385,15 @@ void Application::postLambdaEvent(std::function<void()> f) { · 1 unmodified line
73857385 }
73867386 }
73877387
7388+void Application::sendLambdaEvent(const std::function<void()>& f) {
7389+ if (this->thread() == QThread::currentThread()) {
7390+ f();
7391+ } else {
7392+ LambdaEvent event(f);
7393+ QCoreApplication::sendEvent(this, &event);
7394+ }
7395+}
7396+
73887397 void Application::initPlugins(const QStringList& arguments) {
73897398 QCommandLineOption display("display", "Preferred displays", "displays");
73907399 QCommandLineOption disableDisplays("disable-displays", "Displays to disable", "displays");