Don't recreate QSettings

This commit is contained in:
Matti Viljanen 2021-04-10 02:30:41 +03:00
parent 178dfb9a68
commit 1ae74460cf
No known key found for this signature in database
GPG key ID: CF32A1495158F888

View file

@ -19,8 +19,10 @@
Settings::Settings(QObject *parent) : QObject(parent)
{
mySettings = new QSettings("harbour-batterybuddy", "harbour-batterybuddy");
qDebug() << "Using" << mySettings->fileName();
// Use the same file location as GUI for data exchange
if(!mySettings) {
mySettings = new QSettings("harbour-batterybuddy", "harbour-batterybuddy");
}
// Read in the values
loadInteger(sLowAlert, &lowAlert, 5, 99);