save frequency snap value

This commit is contained in:
Charles J. Cliffe
2015-07-18 21:49:53 -04:00
parent 8827ff9e26
commit db434348a4
3 changed files with 25 additions and 2 deletions
+16 -1
View File
@@ -121,6 +121,7 @@ AppConfig::AppConfig() {
winH.store(0);
winMax.store(false);
themeId.store(0);
snap.store(1);
}
@@ -186,6 +187,15 @@ int AppConfig::getTheme() {
}
void AppConfig::setSnap(long long snapVal) {
this->snap.store(snapVal);
}
long long AppConfig::getSnap() {
return snap.load();
}
bool AppConfig::save() {
DataTree cfg;
@@ -200,8 +210,8 @@ bool AppConfig::save() {
*window_node->newChild("h") = winH.load();
*window_node->newChild("max") = winMax.load();
*window_node->newChild("theme") = themeId.load();
*window_node->newChild("snap") = snap.load();
}
DataNode *devices_node = cfg.rootNode()->newChild("devices");
@@ -275,6 +285,11 @@ bool AppConfig::load() {
themeId.store(theme);
}
if (win_node->hasAnother("snap")) {
long long snapVal;
win_node->getNext("snap")->element()->get(snapVal);
snap.store(snapVal);
}
}
if (cfg.rootNode()->hasAnother("devices")) {