refs #450 Make disk file saving and loading available in core settings.

This commit is contained in:
Mathew Sutcliffe
2015-09-05 16:50:49 +01:00
parent 54bc3f265a
commit f872186866
7 changed files with 66 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
*/
#include "settingscache.h"
#include <QStandardPaths>
namespace BlackCore
{
@@ -22,4 +23,20 @@ namespace BlackCore
return &cache;
}
const QString &CSettingsCache::persistentStore()
{
static const QString dir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/org.swift-project/settings/core";
return dir;
}
BlackMisc::CStatusMessage CSettingsCache::saveToStore(const QString &keyPrefix) const
{
return saveToFiles(persistentStore(), keyPrefix);
}
BlackMisc::CStatusMessage CSettingsCache::loadFromStore()
{
return loadFromFiles(persistentStore());
}
}