*
* @returns false if we're shutting down, true otherwise.
*/
-bool Application::ProcessEvents(void) const
+bool Application::ProcessEvents(void)
{
Object::ClearHeldObjects();
static String GetPkgDataDir(void);
static void SetPkgDataDir(const String& path);
- bool ProcessEvents(void) const;
+ static bool ProcessEvents(void);
protected:
void RunEventLoop(void) const;
*/
void Utility::WaitUntil(const function<bool (void)>& predicate)
{
- while (!predicate()) {
- Application::Ptr instance = Application::GetInstance();
-
- /* Waiting for a predicate requires an application instance.
- * This means we cannot do certain asynchronous things
- * (like spawning a process) until the application instance
- * has been initialized. */
- if (!instance)
- BOOST_THROW_EXCEPTION(runtime_error("Waiting for predicate failed: Application instance is not initialized."));
-
- instance->ProcessEvents();
- }
+ while (!predicate())
+ Application::ProcessEvents();
}