mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
refs #545 CSetting<T>::setAndSave to set and save a setting in one step.
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user