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