Start timers only once at startup

This commit is contained in:
Matti Viljanen 2020-11-30 21:27:57 +02:00
parent 5e2fc08f45
commit d359c95a40

View file

@ -83,17 +83,12 @@ Battery::Battery(QObject *parent) : QObject(parent)
} }
} }
updateData();
connect(updateTimer, SIGNAL(timeout()), this, SLOT(updateData())); connect(updateTimer, SIGNAL(timeout()), this, SLOT(updateData()));
connect(settings, SIGNAL(configChanged()), this, SLOT(updateConfig())); connect(settings, SIGNAL(configChanged()), this, SLOT(updateConfig()));
connect(highNotifyTimer, SIGNAL(timeout()), this, SLOT(showHighNotification())); connect(highNotifyTimer, SIGNAL(timeout()), this, SLOT(showHighNotification()));
connect(lowNotifyTimer, SIGNAL(timeout()), this, SLOT(showLowNotification())); connect(lowNotifyTimer, SIGNAL(timeout()), this, SLOT(showLowNotification()));
updateConfig(); updateTimer->start(5000);
updateTimer->setInterval(5000);
updateTimer->start();
} }
Battery::~Battery() { } Battery::~Battery() { }