diff --git a/src/blackcore/application.cpp b/src/blackcore/application.cpp index e9c3dd93d..ad66e1dc3 100644 --- a/src/blackcore/application.cpp +++ b/src/blackcore/application.cpp @@ -485,7 +485,11 @@ namespace BlackCore QStringList CApplication::getAllUnsavedSettings() const { - return CSettingsCache::instance()->getAllUnsavedKeys(); + if (this->supportsContexts()) + { + return this->getIContextApplication()->getUnsavedSettingsKeys(); + } + return {}; } CStatusMessage CApplication::saveSettingsByKey(const QStringList &keys) @@ -495,10 +499,10 @@ namespace BlackCore { return this->getIContextApplication()->saveSettingsByKey(keys); } - else - { - return CSettingsCache::instance()->saveToStore(keys); - } + //! \todo If contexts have shut down then we already missed the opportunity to save settings. + //! Saving without contexts is not safe. + BLACK_VERIFY(false); + return CSettingsCache::instance()->saveToStore(keys); } QString CApplication::getTemporaryDirectory() const