diff --git a/samples/blackmiscdbus/main.cpp b/samples/blackmiscdbus/main.cpp index 90ac8d7ed..25b321e33 100644 --- a/samples/blackmiscdbus/main.cpp +++ b/samples/blackmiscdbus/main.cpp @@ -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; diff --git a/src/blackcore/application.cpp b/src/blackcore/application.cpp index 969046e50..24cdcc858 100644 --- a/src/blackcore/application.cpp +++ b/src/blackcore/application.cpp @@ -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();