Browse Source

Fix wrong logic that disables "prevent sleeping" timer

Also update power management state early so we don't need to wait for
the timer timeout to have the effect.
adaptive-webui-19844
Chocobo1 5 years ago
parent
commit
09545d4036
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 5
      src/gui/mainwindow.cpp

5
src/gui/mainwindow.cpp

@ -1454,9 +1454,12 @@ void MainWindow::loadPreferences(const bool configureSession)
showStatusBar(pref->isStatusbarDisplayed()); showStatusBar(pref->isStatusbarDisplayed());
if ((pref->preventFromSuspendWhenDownloading() || pref->preventFromSuspendWhenSeeding()) && !m_preventTimer->isActive()) { if (pref->preventFromSuspendWhenDownloading() || pref->preventFromSuspendWhenSeeding()) {
if (!m_preventTimer->isActive()) {
updatePowerManagementState();
m_preventTimer->start(PREVENT_SUSPEND_INTERVAL); m_preventTimer->start(PREVENT_SUSPEND_INTERVAL);
} }
}
else { else {
m_preventTimer->stop(); m_preventTimer->stop();
m_pwr->setActivityState(false); m_pwr->setActivityState(false);

Loading…
Cancel
Save