mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 23:17:21 -06:00
Prevent precise timers from being used when unnecessary
The implementation of QTimer::singleShot() uses Qt::PreciseTimer if interval is less than 2 seconds. This isn't mentioned in the docs. Qt::PreciseTimer increases the system's timer resolution which negatively affects power consumption. PR #18555. Closes #18350.
This commit is contained in:
committed by
GitHub
parent
915121a0dd
commit
7600f59f3a
@@ -502,7 +502,7 @@ void TorrentFilesWatcher::Worker::removeWatchedFolder(const Path &path)
|
||||
|
||||
void TorrentFilesWatcher::Worker::scheduleWatchedFolderProcessing(const Path &path)
|
||||
{
|
||||
QTimer::singleShot(2s, this, [this, path]()
|
||||
QTimer::singleShot(2s, Qt::CoarseTimer, this, [this, path]
|
||||
{
|
||||
processWatchedFolder(path);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user