mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Fix CApplication::processEventsFor so it can be used in samples/unit tests
This commit is contained in:
committed by
Mathew Sutcliffe
parent
769e3a0e29
commit
a993ccd1c1
@@ -81,7 +81,7 @@ int main(int argc, char *argv[])
|
||||
if (clientFlag)
|
||||
{
|
||||
// 2nd Process !!! Running on the client's side
|
||||
// This runs in a second process, hence cannot be directly debugged within Qt Creators
|
||||
// This runs in a second process, hence cannot be directly debugged within Qt Creator
|
||||
out << "Running client side " << QCoreApplication::applicationPid() << endl;
|
||||
|
||||
// run tests
|
||||
@@ -161,8 +161,8 @@ int main(int argc, char *argv[])
|
||||
BlackMisc::CDBusServer *dBusServer = new BlackMisc::CDBusServer(useSessionBusForServer ? "session" : address);
|
||||
if (dBusServer->hasQDBusServer())
|
||||
{
|
||||
out << "server" << dBusServer->qDBusServer()->address() <<
|
||||
" connected:" << dBusServer->qDBusServer()->isConnected() << endl;
|
||||
out << "server" << dBusServer->qDBusServer()->address()
|
||||
<< " connected:" << dBusServer->qDBusServer()->isConnected() << endl;
|
||||
}
|
||||
// start client process
|
||||
QStringList args;
|
||||
|
||||
@@ -712,7 +712,8 @@ namespace BlackCore
|
||||
|
||||
void CApplication::processEventsFor(int milliseconds)
|
||||
{
|
||||
if (CApplication::instance()->isShuttingDown()) { return; }
|
||||
// sApp check allows to use in test cases without sApp
|
||||
if (sApp && sApp->isShuttingDown()) { return; }
|
||||
QEventLoop eventLoop;
|
||||
QTimer::singleShot(milliseconds, &eventLoop, &QEventLoop::quit);
|
||||
eventLoop.exec();
|
||||
|
||||
Reference in New Issue
Block a user