From 13c1941c39ab0d2750fa549196d1d69d6111b8a2 Mon Sep 17 00:00:00 2001 From: skyjake Date: Tue, 9 Apr 2013 18:00:36 +0300 Subject: [PATCH] libdeng2|App: Added audience for startup completion --- doomsday/client/src/dd_main.cpp | 7 +++++++ doomsday/libdeng2/include/de/core/app.h | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/doomsday/client/src/dd_main.cpp b/doomsday/client/src/dd_main.cpp index 4aed999e7c..f49c26249f 100644 --- a/doomsday/client/src/dd_main.cpp +++ b/doomsday/client/src/dd_main.cpp @@ -1782,6 +1782,13 @@ void DD_FinishInitializationAfterWindowReady() exit(2); // Cannot continue... return; } + + /// @todo This notification should be done from the app. + for(de::App::StartupCompleteAudience::Loop iter(de::App::app().audienceForStartupComplete); + !iter.done(); ++iter) + { + iter->appStartupCompleted(); + } } /** diff --git a/doomsday/libdeng2/include/de/core/app.h b/doomsday/libdeng2/include/de/core/app.h index dddd93d705..a1c72f9260 100644 --- a/doomsday/libdeng2/include/de/core/app.h +++ b/doomsday/libdeng2/include/de/core/app.h @@ -58,6 +58,12 @@ class DENG2_PUBLIC App : DENG2_OBSERVES(Clock, TimeChange) }; Q_DECLARE_FLAGS(SubsystemInitFlags, SubsystemInitFlag) + /** + * Observers to be notified when application startup has been fully + * completed. + */ + DENG2_DEFINE_AUDIENCE(StartupComplete, void appStartupCompleted()) + public: /** * Construct an App instance. The application will not be fully usable