mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 01:03:08 -07:00
Make use of std algorithms
This commit is contained in:
parent
40eb8a1f4a
commit
6d29a3af60
10 changed files with 67 additions and 61 deletions
|
@ -28,6 +28,8 @@
|
|||
|
||||
#include "torrentcontentmodel.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileIconProvider>
|
||||
#include <QFileInfo>
|
||||
|
@ -275,10 +277,10 @@ QVector<int> TorrentContentModel::getFilePriorities() const
|
|||
|
||||
bool TorrentContentModel::allFiltered() const
|
||||
{
|
||||
for (const TorrentContentModelFile *fileItem : asConst(m_filesIndex))
|
||||
if (fileItem->priority() != BitTorrent::FilePriority::Ignored)
|
||||
return false;
|
||||
return true;
|
||||
return std::all_of(m_filesIndex.cbegin(), m_filesIndex.cend(), [](const TorrentContentModelFile *fileItem)
|
||||
{
|
||||
return (fileItem->priority() == BitTorrent::FilePriority::Ignored);
|
||||
});
|
||||
}
|
||||
|
||||
int TorrentContentModel::columnCount(const QModelIndex &parent) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue