Migrate old setting keys

This commit is contained in:
Matti Viljanen 2020-03-20 23:02:07 +02:00
parent 65627705ff
commit 4cd2dba0d7
No known key found for this signature in database
GPG key ID: CF32A1495158F888

View file

@ -19,6 +19,18 @@
Settings::Settings(QObject *parent) : QObject(parent)
{
// Migrate old settings
if(mySettings.contains("lowerLimit")) {
mySettings.setValue(sLowAlert, mySettings.value("lowerLimit"));
mySettings.remove("lowerLimit");
}
if(mySettings.contains("upperLimit")) {
mySettings.setValue(sHighAlert, mySettings.value("upperLimit"));
mySettings.remove("upperLimit");
}
// Read in the values
int tempValue;
tempValue = mySettings.value(sLowAlert, lowAlert).toInt();
if(tempValue >= 10 && tempValue <= 99) {