Ref T163, using settings descriptions

* renamed to getUnsavedSettingsKeys
* no private slots in close dialog
* use descriptions instead of keys
This commit is contained in:
Klaus Basan
2017-09-26 20:08:02 +02:00
parent 4fcdd0e1f0
commit 3cf97b3f37
4 changed files with 40 additions and 37 deletions

View File

@@ -538,7 +538,7 @@ namespace BlackCore
bool CApplication::hasUnsavedSettings() const
{
return !this->getAllUnsavedSettings().isEmpty();
return !this->getUnsavedSettingsKeys().isEmpty();
}
void CApplication::setSettingsAutoSave(bool autoSave)
@@ -546,23 +546,19 @@ namespace BlackCore
m_autoSaveSettings = autoSave;
}
QStringList CApplication::getAllUnsavedSettings() const
QStringList CApplication::getUnsavedSettingsKeys() const
{
if (this->supportsContexts())
{
return this->getIContextApplication()->getUnsavedSettingsKeys();
}
return {};
return this->supportsContexts() ?
this->getIContextApplication()->getUnsavedSettingsKeys() :
CSettingsCache::instance()->getAllUnsavedKeys();
}
CStatusMessage CApplication::saveSettingsByKey(const QStringList &keys)
{
if (keys.isEmpty()) { return CStatusMessage(); }
if (this->supportsContexts())
{
return this->getIContextApplication()->saveSettingsByKey(keys);
}
return CSettingsCache::instance()->saveToStore(keys);
return this->supportsContexts() ?
this->getIContextApplication()->saveSettingsByKey(keys) :
CSettingsCache::instance()->saveToStore(keys);
}
QString CApplication::getTemporaryDirectory() const

View File

@@ -197,6 +197,7 @@ namespace BlackCore
BlackMisc::CStatusMessageList requestReloadOfSetupAndVersion();
//! Web data services available?
//! \threadsafe
bool hasWebDataServices() const;
//! Get the web data services
@@ -234,7 +235,7 @@ namespace BlackCore
void setSettingsAutoSave(bool autoSave);
//! All unsaved settings
QStringList getAllUnsavedSettings() const;
QStringList getUnsavedSettingsKeys() const;
//! Save all settings
BlackMisc::CStatusMessage saveSettingsByKey(const QStringList &keys);