mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-29 05:48:47 +03:00
Add const to function parameters
This commit is contained in:
parent
e59841d35c
commit
9bd8587c68
2 changed files with 11 additions and 11 deletions
|
@ -138,14 +138,14 @@ bool TorrentFilter::setTag(const QString &tag)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TorrentFilter::match(TorrentHandle *const torrent) const
|
bool TorrentFilter::match(const TorrentHandle *const torrent) const
|
||||||
{
|
{
|
||||||
if (!torrent) return false;
|
if (!torrent) return false;
|
||||||
|
|
||||||
return (matchState(torrent) && matchHash(torrent) && matchCategory(torrent) && matchTag(torrent));
|
return (matchState(torrent) && matchHash(torrent) && matchCategory(torrent) && matchTag(torrent));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TorrentFilter::matchState(BitTorrent::TorrentHandle *const torrent) const
|
bool TorrentFilter::matchState(const BitTorrent::TorrentHandle *const torrent) const
|
||||||
{
|
{
|
||||||
switch (m_type) {
|
switch (m_type) {
|
||||||
case All:
|
case All:
|
||||||
|
@ -171,19 +171,19 @@ bool TorrentFilter::matchState(BitTorrent::TorrentHandle *const torrent) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TorrentFilter::matchHash(BitTorrent::TorrentHandle *const torrent) const
|
bool TorrentFilter::matchHash(const BitTorrent::TorrentHandle *const torrent) const
|
||||||
{
|
{
|
||||||
if (m_hashSet == AnyHash) return true;
|
if (m_hashSet == AnyHash) return true;
|
||||||
else return m_hashSet.contains(torrent->hash());
|
else return m_hashSet.contains(torrent->hash());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TorrentFilter::matchCategory(BitTorrent::TorrentHandle *const torrent) const
|
bool TorrentFilter::matchCategory(const BitTorrent::TorrentHandle *const torrent) const
|
||||||
{
|
{
|
||||||
if (m_category.isNull()) return true;
|
if (m_category.isNull()) return true;
|
||||||
else return (torrent->belongsToCategory(m_category));
|
else return (torrent->belongsToCategory(m_category));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TorrentFilter::matchTag(BitTorrent::TorrentHandle *const torrent) const
|
bool TorrentFilter::matchTag(const BitTorrent::TorrentHandle *const torrent) const
|
||||||
{
|
{
|
||||||
// Empty tag is a special value to indicate we're filtering for untagged torrents.
|
// Empty tag is a special value to indicate we're filtering for untagged torrents.
|
||||||
if (m_tag.isNull()) return true;
|
if (m_tag.isNull()) return true;
|
||||||
|
|
|
@ -81,13 +81,13 @@ public:
|
||||||
bool setCategory(const QString &category);
|
bool setCategory(const QString &category);
|
||||||
bool setTag(const QString &tag);
|
bool setTag(const QString &tag);
|
||||||
|
|
||||||
bool match(BitTorrent::TorrentHandle *const torrent) const;
|
bool match(const BitTorrent::TorrentHandle *torrent) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool matchState(BitTorrent::TorrentHandle *const torrent) const;
|
bool matchState(const BitTorrent::TorrentHandle *torrent) const;
|
||||||
bool matchHash(BitTorrent::TorrentHandle *const torrent) const;
|
bool matchHash(const BitTorrent::TorrentHandle *torrent) const;
|
||||||
bool matchCategory(BitTorrent::TorrentHandle *const torrent) const;
|
bool matchCategory(const BitTorrent::TorrentHandle *torrent) const;
|
||||||
bool matchTag(BitTorrent::TorrentHandle *const torrent) const;
|
bool matchTag(const BitTorrent::TorrentHandle *torrent) const;
|
||||||
|
|
||||||
Type m_type;
|
Type m_type;
|
||||||
QString m_category;
|
QString m_category;
|
||||||
|
|
Loading…
Reference in a new issue