mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 16:23:07 -07:00
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.
This commit is contained in:
parent
3752453522
commit
09545d4036
1 changed files with 5 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue