Skip to content

Commit

Permalink
Fix wrong logic that disables "prevent sleeping" timer
Browse files Browse the repository at this point in the history
Also update power management state early so we don't need to wait for
the timer timeout to have the effect.
  • Loading branch information
Chocobo1 authored and sledgehammer999 committed Apr 22, 2020
1 parent a9f43bd commit 80016db
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1454,8 +1454,11 @@ void MainWindow::loadPreferences(const bool configureSession)

showStatusBar(pref->isStatusbarDisplayed());

if ((pref->preventFromSuspendWhenDownloading() || pref->preventFromSuspendWhenSeeding()) && !m_preventTimer->isActive()) {
m_preventTimer->start(PREVENT_SUSPEND_INTERVAL);
if (pref->preventFromSuspendWhenDownloading() || pref->preventFromSuspendWhenSeeding()) {
if (!m_preventTimer->isActive()) {
updatePowerManagementState();
m_preventTimer->start(PREVENT_SUSPEND_INTERVAL);
}
}
else {
m_preventTimer->stop();
Expand Down

0 comments on commit 80016db

Please sign in to comment.