Showing the changes to interface/src/Application.cpp (1 of 31 files). Show all
Unified · Split
| @@ -4753,7 +4753,7 @@ void Application::updateLOD(float deltaTime) const { · 4752 unmodified lines | ||
| 4753 | 4753 | } |
| 4754 | 4754 | } |
| 4755 | 4755 | |
| 4756 | −void Application::pushPostUpdateLambda(void* key, std::function<void()> func) { | |
| 4756 | +void Application::pushPostUpdateLambda(void* key, const std::function<void()>& func) { | |
| 4757 | 4757 | std::unique_lock<std::mutex> guard(_postUpdateLambdasLock); |
| 4758 | 4758 | _postUpdateLambdas[key] = func; |
| 4759 | 4759 | } |
| @@ -7377,7 +7377,7 @@ void Application::windowMinimizedChanged(bool minimized) { · 2617 unmodified lines | ||
| 7377 | 7377 | } |
| 7378 | 7378 | } |
| 7379 | 7379 | |
| 7380 | −void Application::postLambdaEvent(std::function<void()> f) { | |
| 7380 | +void Application::postLambdaEvent(const std::function<void()>& f) { | |
| 7381 | 7381 | if (this->thread() == QThread::currentThread()) { |
| 7382 | 7382 | f(); |
| 7383 | 7383 | } else { |
| @@ -7385,6 +7385,15 @@ void Application::postLambdaEvent(std::function<void()> f) { · 1 unmodified line | ||
| 7385 | 7385 | } |
| 7386 | 7386 | } |
| 7387 | 7387 | |
| 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 | + | |
| 7388 | 7397 | void Application::initPlugins(const QStringList& arguments) { |
| 7389 | 7398 | QCommandLineOption display("display", "Preferred displays", "displays"); |
| 7390 | 7399 | QCommandLineOption disableDisplays("disable-displays", "Displays to disable", "displays"); |