mirror of https://github.com/Icinga/icinga2.git
Make Application::ProcessEvents() static.
This commit is contained in:
parent
d744f9fb7c
commit
2893134940
|
@ -91,7 +91,7 @@ Application::Ptr Application::GetInstance(void)
|
||||||
*
|
*
|
||||||
* @returns false if we're shutting down, true otherwise.
|
* @returns false if we're shutting down, true otherwise.
|
||||||
*/
|
*/
|
||||||
bool Application::ProcessEvents(void) const
|
bool Application::ProcessEvents(void)
|
||||||
{
|
{
|
||||||
Object::ClearHeldObjects();
|
Object::ClearHeldObjects();
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ public:
|
||||||
static String GetPkgDataDir(void);
|
static String GetPkgDataDir(void);
|
||||||
static void SetPkgDataDir(const String& path);
|
static void SetPkgDataDir(const String& path);
|
||||||
|
|
||||||
bool ProcessEvents(void) const;
|
static bool ProcessEvents(void);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void RunEventLoop(void) const;
|
void RunEventLoop(void) const;
|
||||||
|
|
|
@ -522,17 +522,7 @@ bool Utility::Glob(const String& pathSpec, const function<void (const String&)>&
|
||||||
*/
|
*/
|
||||||
void Utility::WaitUntil(const function<bool (void)>& predicate)
|
void Utility::WaitUntil(const function<bool (void)>& predicate)
|
||||||
{
|
{
|
||||||
while (!predicate()) {
|
while (!predicate())
|
||||||
Application::Ptr instance = Application::GetInstance();
|
Application::ProcessEvents();
|
||||||
|
|
||||||
/* 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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue