Let daemon migrate old settings

This commit is contained in:
Matti Viljanen 2020-06-14 18:26:10 +03:00
parent 61d9dae5ac
commit c9af158062
No known key found for this signature in database
GPG key ID: CF32A1495158F888

View file

@ -22,19 +22,6 @@ Settings::Settings(QObject *parent) : QObject(parent)
mySettings = new QSettings("harbour-batterybuddy", "harbour-batterybuddy");
qDebug() << "Using" << mySettings->fileName();
// Migrate old settings
if(mySettings->contains("lowerLimit")) {
mySettings->setValue(sLowAlert, mySettings->value("lowerLimit"));
mySettings->remove("lowerLimit");
qInfo() << "Migrated old lowerLimit value";
}
if(mySettings->contains("upperLimit")) {
mySettings->setValue(sHighAlert, mySettings->value("upperLimit"));
mySettings->remove("upperLimit");
qInfo() << "Migrated old upperLimit value";
}
// Read in the values
loadInteger(sLowAlert, &lowAlert, 10, 99);
loadInteger(sHighAlert, &highAlert, 11, 100);