Utility function "isDefault" in settings cache

This commit is contained in:
Klaus Basan
2020-01-15 02:40:24 +01:00
parent 143ac8576a
commit 455dc23b84
2 changed files with 7 additions and 4 deletions

View File

@@ -99,7 +99,10 @@ namespace BlackMisc
CStatusMessage setDefault() { return this->set(Trait::defaultValue()); }
//! Gets the default value
auto getDefault() { return Trait::defaultValue(); }
auto getDefault() const { return Trait::defaultValue(); }
//! Is default value?
bool isDefault() const { return this->getDefault() == this->get(); }
//! Return the file that is used for persistence for this value.
QString getFilename() const { return CSettingsCache::filenameForKey(this->getKey()); }