refs #545 CSetting<T>::setAndSave to set and save a setting in one step.

This commit is contained in:
Mathew Sutcliffe
2016-01-10 20:43:21 +00:00
parent d9167cf226
commit 956d393bb1
7 changed files with 33 additions and 6 deletions

View File

@@ -8,6 +8,7 @@
*/
#include "settingscache.h"
#include "logmessage.h"
#include <QStandardPaths>
namespace BlackMisc
@@ -33,6 +34,15 @@ namespace BlackMisc
return saveToFiles(persistentStore(), keyPrefix);
}
void CSettingsCache::saveToStoreByPacket(const CValueCachePacket &values)
{
CStatusMessage status = saveToFiles(persistentStore(), values.toVariantMap());
if (! status.isEmpty())
{
CLogMessage(this).preformatted(status);
}
}
BlackMisc::CStatusMessage CSettingsCache::loadFromStore()
{
return loadFromFiles(persistentStore());