Always write changes to disk immediately
This commit is contained in:
parent
1ee2d9e708
commit
be4e2f335d
1 changed files with 14 additions and 0 deletions
|
@ -97,42 +97,56 @@ QString Settings::getHighAlertFile() {
|
||||||
|
|
||||||
void Settings::setLowAlert(int newLimit) {
|
void Settings::setLowAlert(int newLimit) {
|
||||||
lowAlert = newLimit;
|
lowAlert = newLimit;
|
||||||
|
saveInteger(sLowAlert, &lowAlert);
|
||||||
|
mySettings->sync();
|
||||||
emit lowAlertChanged(lowAlert);
|
emit lowAlertChanged(lowAlert);
|
||||||
qDebug() << "Change" << sLowAlert << newLimit;
|
qDebug() << "Change" << sLowAlert << newLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setHighAlert(int newLimit) {
|
void Settings::setHighAlert(int newLimit) {
|
||||||
highAlert = newLimit;
|
highAlert = newLimit;
|
||||||
|
saveInteger(sHighAlert, &highAlert);
|
||||||
|
mySettings->sync();
|
||||||
emit highAlertChanged(highAlert);
|
emit highAlertChanged(highAlert);
|
||||||
qDebug() << "Change" << sHighAlert << newLimit;
|
qDebug() << "Change" << sHighAlert << newLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setInterval(int newInterval) {
|
void Settings::setInterval(int newInterval) {
|
||||||
interval = newInterval;
|
interval = newInterval;
|
||||||
|
saveInteger(sInterval, &interval);
|
||||||
|
mySettings->sync();
|
||||||
emit intervalChanged(interval);
|
emit intervalChanged(interval);
|
||||||
qDebug() << "Change" << sInterval << newInterval;
|
qDebug() << "Change" << sInterval << newInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setLowLimit(int newLimit) {
|
void Settings::setLowLimit(int newLimit) {
|
||||||
lowLimit = newLimit;
|
lowLimit = newLimit;
|
||||||
|
saveInteger(sLowLimit, &lowLimit);
|
||||||
|
mySettings->sync();
|
||||||
emit lowLimitChanged(lowLimit);
|
emit lowLimitChanged(lowLimit);
|
||||||
qDebug() << "Change" << sLowLimit << newLimit;
|
qDebug() << "Change" << sLowLimit << newLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setHighLimit(int newLimit) {
|
void Settings::setHighLimit(int newLimit) {
|
||||||
highLimit = newLimit;
|
highLimit = newLimit;
|
||||||
|
saveInteger(sHighLimit, &highLimit);
|
||||||
|
mySettings->sync();
|
||||||
emit highLimitChanged(highLimit);
|
emit highLimitChanged(highLimit);
|
||||||
qDebug() << "Change" << sHighLimit << newLimit;
|
qDebug() << "Change" << sHighLimit << newLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setLimitEnabled(bool newEnabled) {
|
void Settings::setLimitEnabled(bool newEnabled) {
|
||||||
limitEnabled = (newEnabled ? 1 : 0);
|
limitEnabled = (newEnabled ? 1 : 0);
|
||||||
|
saveInteger(sLimitEnabled, &limitEnabled);
|
||||||
|
mySettings->sync();
|
||||||
emit limitEnabledChanged(limitEnabled);
|
emit limitEnabledChanged(limitEnabled);
|
||||||
qDebug() << "Change" << sLimitEnabled << newEnabled;
|
qDebug() << "Change" << sLimitEnabled << newEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setNotificationsEnabled(bool newEnabled) {
|
void Settings::setNotificationsEnabled(bool newEnabled) {
|
||||||
notificationsEnabled = (newEnabled ? 1 : 0);
|
notificationsEnabled = (newEnabled ? 1 : 0);
|
||||||
|
saveInteger(sNotificationsEnabled, ¬ificationsEnabled);
|
||||||
|
mySettings->sync();
|
||||||
emit notificationsEnabledChanged(notificationsEnabled);
|
emit notificationsEnabledChanged(notificationsEnabled);
|
||||||
qDebug() << "Change" << sNotificationsEnabled << newEnabled;
|
qDebug() << "Change" << sNotificationsEnabled << newEnabled;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue