mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 00:47:21 -06:00
Add a "Moving" status filter
Because sometime (when your save and download path are on different drives, when your disk drive is super busy, ...) move operations can stack up, I add this "Moving" status filter so you can see in a blink of the eye which torrents are in a move state. PR #17810.
This commit is contained in:
@@ -222,6 +222,7 @@ namespace BitTorrent
|
||||
virtual bool isForced() const = 0;
|
||||
virtual bool isChecking() const = 0;
|
||||
virtual bool isDownloading() const = 0;
|
||||
virtual bool isMoving() const = 0;
|
||||
virtual bool isUploading() const = 0;
|
||||
virtual bool isCompleted() const = 0;
|
||||
virtual bool isActive() const = 0;
|
||||
|
||||
@@ -873,6 +873,11 @@ bool TorrentImpl::isDownloading() const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TorrentImpl::isMoving() const
|
||||
{
|
||||
return m_state == TorrentState::Moving;
|
||||
}
|
||||
|
||||
bool TorrentImpl::isUploading() const
|
||||
{
|
||||
switch (m_state)
|
||||
|
||||
@@ -145,6 +145,7 @@ namespace BitTorrent
|
||||
bool isForced() const override;
|
||||
bool isChecking() const override;
|
||||
bool isDownloading() const override;
|
||||
bool isMoving() const override;
|
||||
bool isUploading() const override;
|
||||
bool isCompleted() const override;
|
||||
bool isActive() const override;
|
||||
|
||||
@@ -46,6 +46,7 @@ const TorrentFilter TorrentFilter::StalledTorrent(TorrentFilter::Stalled);
|
||||
const TorrentFilter TorrentFilter::StalledUploadingTorrent(TorrentFilter::StalledUploading);
|
||||
const TorrentFilter TorrentFilter::StalledDownloadingTorrent(TorrentFilter::StalledDownloading);
|
||||
const TorrentFilter TorrentFilter::CheckingTorrent(TorrentFilter::Checking);
|
||||
const TorrentFilter TorrentFilter::MovingTorrent(TorrentFilter::Moving);
|
||||
const TorrentFilter TorrentFilter::ErroredTorrent(TorrentFilter::Errored);
|
||||
|
||||
using BitTorrent::Torrent;
|
||||
@@ -106,6 +107,8 @@ bool TorrentFilter::setTypeByName(const QString &filter)
|
||||
type = StalledDownloading;
|
||||
else if (filter == u"checking")
|
||||
type = Checking;
|
||||
else if (filter == u"moving")
|
||||
type = Moving;
|
||||
else if (filter == u"errored")
|
||||
type = Errored;
|
||||
|
||||
@@ -184,6 +187,8 @@ bool TorrentFilter::matchState(const BitTorrent::Torrent *const torrent) const
|
||||
return (torrent->state() == BitTorrent::TorrentState::CheckingUploading)
|
||||
|| (torrent->state() == BitTorrent::TorrentState::CheckingDownloading)
|
||||
|| (torrent->state() == BitTorrent::TorrentState::CheckingResumeData);
|
||||
case Moving:
|
||||
return torrent->isMoving();
|
||||
case Errored:
|
||||
return torrent->isErrored();
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ public:
|
||||
StalledUploading,
|
||||
StalledDownloading,
|
||||
Checking,
|
||||
Moving,
|
||||
Errored
|
||||
};
|
||||
|
||||
@@ -78,6 +79,7 @@ public:
|
||||
static const TorrentFilter StalledUploadingTorrent;
|
||||
static const TorrentFilter StalledDownloadingTorrent;
|
||||
static const TorrentFilter CheckingTorrent;
|
||||
static const TorrentFilter MovingTorrent;
|
||||
static const TorrentFilter ErroredTorrent;
|
||||
|
||||
TorrentFilter() = default;
|
||||
|
||||
Reference in New Issue
Block a user