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) {
|
||||
lowAlert = newLimit;
|
||||
saveInteger(sLowAlert, &lowAlert);
|
||||
mySettings->sync();
|
||||
emit lowAlertChanged(lowAlert);
|
||||
qDebug() << "Change" << sLowAlert << newLimit;
|
||||
}
|
||||
|
||||
void Settings::setHighAlert(int newLimit) {
|
||||
highAlert = newLimit;
|
||||
saveInteger(sHighAlert, &highAlert);
|
||||
mySettings->sync();
|
||||
emit highAlertChanged(highAlert);
|
||||
qDebug() << "Change" << sHighAlert << newLimit;
|
||||
}
|
||||
|
||||
void Settings::setInterval(int newInterval) {
|
||||
interval = newInterval;
|
||||
saveInteger(sInterval, &interval);
|
||||
mySettings->sync();
|
||||
emit intervalChanged(interval);
|
||||
qDebug() << "Change" << sInterval << newInterval;
|
||||
}
|
||||
|
||||
void Settings::setLowLimit(int newLimit) {
|
||||
lowLimit = newLimit;
|
||||
saveInteger(sLowLimit, &lowLimit);
|
||||
mySettings->sync();
|
||||
emit lowLimitChanged(lowLimit);
|
||||
qDebug() << "Change" << sLowLimit << newLimit;
|
||||
}
|
||||
|
||||
void Settings::setHighLimit(int newLimit) {
|
||||
highLimit = newLimit;
|
||||
saveInteger(sHighLimit, &highLimit);
|
||||
mySettings->sync();
|
||||
emit highLimitChanged(highLimit);
|
||||
qDebug() << "Change" << sHighLimit << newLimit;
|
||||
}
|
||||
|
||||
void Settings::setLimitEnabled(bool newEnabled) {
|
||||
limitEnabled = (newEnabled ? 1 : 0);
|
||||
saveInteger(sLimitEnabled, &limitEnabled);
|
||||
mySettings->sync();
|
||||
emit limitEnabledChanged(limitEnabled);
|
||||
qDebug() << "Change" << sLimitEnabled << newEnabled;
|
||||
}
|
||||
|
||||
void Settings::setNotificationsEnabled(bool newEnabled) {
|
||||
notificationsEnabled = (newEnabled ? 1 : 0);
|
||||
saveInteger(sNotificationsEnabled, ¬ificationsEnabled);
|
||||
mySettings->sync();
|
||||
emit notificationsEnabledChanged(notificationsEnabled);
|
||||
qDebug() << "Change" << sNotificationsEnabled << newEnabled;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue