Make Application::ProcessEvents() static.

This commit is contained in:
Gunnar Beutner 2013-02-13 07:25:36 +01:00
parent d744f9fb7c
commit 2893134940
3 changed files with 4 additions and 14 deletions

View File

@ -91,7 +91,7 @@ Application::Ptr Application::GetInstance(void)
*
* @returns false if we're shutting down, true otherwise.
*/
bool Application::ProcessEvents(void) const
bool Application::ProcessEvents(void)
{
Object::ClearHeldObjects();

View File

@ -76,7 +76,7 @@ public:
static String GetPkgDataDir(void);
static void SetPkgDataDir(const String& path);
bool ProcessEvents(void) const;
static bool ProcessEvents(void);
protected:
void RunEventLoop(void) const;

View File

@ -522,17 +522,7 @@ bool Utility::Glob(const String& pathSpec, const function<void (const String&)>&
*/
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();
}