mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
parent
d65d8558d6
commit
775b38079f
1 changed files with 12 additions and 8 deletions
|
@ -156,10 +156,11 @@ bool TorrentFilter::match(const Torrent *const torrent) const
|
||||||
|
|
||||||
bool TorrentFilter::matchState(const BitTorrent::Torrent *const torrent) const
|
bool TorrentFilter::matchState(const BitTorrent::Torrent *const torrent) const
|
||||||
{
|
{
|
||||||
|
const BitTorrent::TorrentState state = torrent->state();
|
||||||
|
|
||||||
switch (m_type)
|
switch (m_type)
|
||||||
{
|
{
|
||||||
case All:
|
case All:
|
||||||
default:
|
|
||||||
return true;
|
return true;
|
||||||
case Downloading:
|
case Downloading:
|
||||||
return torrent->isDownloading();
|
return torrent->isDownloading();
|
||||||
|
@ -176,20 +177,23 @@ bool TorrentFilter::matchState(const BitTorrent::Torrent *const torrent) const
|
||||||
case Inactive:
|
case Inactive:
|
||||||
return torrent->isInactive();
|
return torrent->isInactive();
|
||||||
case Stalled:
|
case Stalled:
|
||||||
return (torrent->state() == BitTorrent::TorrentState::StalledUploading)
|
return (state == BitTorrent::TorrentState::StalledUploading)
|
||||||
|| (torrent->state() == BitTorrent::TorrentState::StalledDownloading);
|
|| (state == BitTorrent::TorrentState::StalledDownloading);
|
||||||
case StalledUploading:
|
case StalledUploading:
|
||||||
return torrent->state() == BitTorrent::TorrentState::StalledUploading;
|
return state == BitTorrent::TorrentState::StalledUploading;
|
||||||
case StalledDownloading:
|
case StalledDownloading:
|
||||||
return torrent->state() == BitTorrent::TorrentState::StalledDownloading;
|
return state == BitTorrent::TorrentState::StalledDownloading;
|
||||||
case Checking:
|
case Checking:
|
||||||
return (torrent->state() == BitTorrent::TorrentState::CheckingUploading)
|
return (state == BitTorrent::TorrentState::CheckingUploading)
|
||||||
|| (torrent->state() == BitTorrent::TorrentState::CheckingDownloading)
|
|| (state == BitTorrent::TorrentState::CheckingDownloading)
|
||||||
|| (torrent->state() == BitTorrent::TorrentState::CheckingResumeData);
|
|| (state == BitTorrent::TorrentState::CheckingResumeData);
|
||||||
case Moving:
|
case Moving:
|
||||||
return torrent->isMoving();
|
return torrent->isMoving();
|
||||||
case Errored:
|
case Errored:
|
||||||
return torrent->isErrored();
|
return torrent->isErrored();
|
||||||
|
default:
|
||||||
|
Q_ASSERT(false);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue