Detect if running with DBus (core + GUI) or just "standalone" (no swift DBus)

This commit is contained in:
Klaus Basan
2020-01-21 18:09:49 +01:00
parent 2704d5e542
commit 4378b6c959
3 changed files with 16 additions and 0 deletions

View File

@@ -903,6 +903,16 @@ namespace BlackCore
return this->startWebDataServices();
}
bool CApplication::isLocalContext() const
{
return this->getIContextApplication() && this->getIContextApplication()->isUsingImplementingObject();
}
bool CApplication::isDBusContext() const
{
return this->getIContextApplication() && !this->getIContextApplication()->isUsingImplementingObject() && !this->getIContextApplication()->isEmptyObject();
}
CStatusMessageList CApplication::startCoreFacadeAndWebDataServices()
{
Q_ASSERT_X(m_parsed, Q_FUNC_INFO, "Call this function after parsing");

View File

@@ -364,6 +364,11 @@ namespace BlackCore
//! Get the facade
CCoreFacade *getCoreFacade() { return m_coreFacade.data(); }
//! Local or DBus application? @{
bool isLocalContext() const;
bool isDBusContext() const;
//! @}
//! Get the facade
const CCoreFacade *getCoreFacade() const { return m_coreFacade.data(); }
//! @}

View File

@@ -362,6 +362,7 @@ void SwiftGuiStd::setContextAvailability()
if (m_coreAvailable)
{
// core has just become available (startup)
// this HERE is called with and without DBus
sGui->getIContextApplication()->synchronizeLogSubscriptions();
sGui->getIContextApplication()->synchronizeLocalSettings();
}