diff --git a/src/blackcore/application.cpp b/src/blackcore/application.cpp index fefa49e80..220840c9c 100644 --- a/src/blackcore/application.cpp +++ b/src/blackcore/application.cpp @@ -1434,11 +1434,17 @@ namespace BlackCore QPointer CApplication::getISimulator() const { - if (!this->getCoreFacade()) { return nullptr; } - if (!this->getCoreFacade()->getCContextSimulator()) { return nullptr; } + if (!this->hasSimulator()) { return nullptr; } return this->getCoreFacade()->getCContextSimulator()->simulator(); } + bool CApplication::hasSimulator() const + { + if (!this->getCoreFacade()) { return false; } + if (!this->getCoreFacade()->getIContextSimulator()->isUsingImplementingObject()) { return false; } + return (this->getCoreFacade()->getCContextSimulator()); // should always be true + } + void CApplication::cmdLineHelpMessage() { m_parser.showHelp(); // terminates diff --git a/src/blackcore/application.h b/src/blackcore/application.h index 209e16437..2455ba397 100644 --- a/src/blackcore/application.h +++ b/src/blackcore/application.h @@ -331,6 +331,9 @@ namespace BlackCore //! The simulator plugin, if available QPointer getISimulator() const; + //! Simulator object available? + bool hasSimulator() const; + // ----------------------- contexts ---------------------------------------- //! \name Context / core facade related