mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 15:25:34 +08:00
Ref T163, using settings descriptions
* renamed to getUnsavedSettingsKeys * no private slots in close dialog * use descriptions instead of keys
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user