mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-21 08:09:35 +08: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
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user