Rename isSeed to isFinished to correctly represent its meaning

PR #18580.
This commit is contained in:
Vladimir Golovnev
2023-02-17 07:08:00 +03:00
committed by GitHub
parent 4c0ebc0e0f
commit 1e913f46f0
11 changed files with 47 additions and 45 deletions

View File

@@ -1906,11 +1906,11 @@ void MainWindow::updatePowerManagementState()
const QVector<BitTorrent::Torrent *> allTorrents = BitTorrent::Session::instance()->torrents();
const bool hasUnfinishedTorrents = std::any_of(allTorrents.cbegin(), allTorrents.cend(), [](const BitTorrent::Torrent *torrent)
{
return (!torrent->isSeed() && !torrent->isPaused() && !torrent->isErrored() && torrent->hasMetadata());
return (!torrent->isFinished() && !torrent->isPaused() && !torrent->isErrored() && torrent->hasMetadata());
});
const bool hasRunningSeed = std::any_of(allTorrents.cbegin(), allTorrents.cend(), [](const BitTorrent::Torrent *torrent)
{
return (torrent->isSeed() && !torrent->isPaused());
return (torrent->isFinished() && !torrent->isPaused());
});
const bool inhibitSuspend = (Preferences::instance()->preventFromSuspendWhenDownloading() && hasUnfinishedTorrents)
|| (Preferences::instance()->preventFromSuspendWhenSeeding() && hasRunningSeed);