mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-22 08:27:24 -06: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:
committed by
sledgehammer999
parent
a9f43bd5d2
commit
80016db781
@@ -1454,8 +1454,11 @@ 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()) {
|
||||||
m_preventTimer->start(PREVENT_SUSPEND_INTERVAL);
|
if (!m_preventTimer->isActive()) {
|
||||||
|
updatePowerManagementState();
|
||||||
|
m_preventTimer->start(PREVENT_SUSPEND_INTERVAL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_preventTimer->stop();
|
m_preventTimer->stop();
|
||||||
|
|||||||
Reference in New Issue
Block a user