1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-23 13:04:23 +00:00

Clean up code

This commit is contained in:
Chocobo1 2020-04-28 02:38:20 +08:00
parent 4f820163ff
commit f6eb341b32
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
3 changed files with 3 additions and 3 deletions

View File

@ -2124,7 +2124,7 @@ QVector<qreal> TorrentHandleImpl::availableFileFractions() const
const QVector<int> piecesAvailability = pieceAvailability(); const QVector<int> piecesAvailability = pieceAvailability();
// libtorrent returns empty array for seeding only torrents // libtorrent returns empty array for seeding only torrents
if (piecesAvailability.empty()) return QVector<qreal>(filesCount, -1.); if (piecesAvailability.empty()) return QVector<qreal>(filesCount, -1);
QVector<qreal> res; QVector<qreal> res;
res.reserve(filesCount); res.reserve(filesCount);

View File

@ -233,7 +233,7 @@ void TorrentContentModel::updateFilesAvailability(const QVector<qreal> &fa)
if (m_filesIndex.size() != fa.size()) return; if (m_filesIndex.size() != fa.size()) return;
emit layoutAboutToBeChanged(); emit layoutAboutToBeChanged();
for (int i = 0; i < fa.size(); ++i) for (int i = 0; i < m_filesIndex.size(); ++i)
m_filesIndex[i]->setAvailability(fa[i]); m_filesIndex[i]->setAvailability(fa[i]);
// Update folders progress in the tree // Update folders progress in the tree
m_rootItem->recalculateProgress(); m_rootItem->recalculateProgress();

View File

@ -73,7 +73,7 @@ void TorrentContentModelFile::setProgress(qreal progress)
Q_ASSERT(m_progress <= 1.); Q_ASSERT(m_progress <= 1.);
} }
void TorrentContentModelFile::setAvailability(qreal availability) void TorrentContentModelFile::setAvailability(const qreal availability)
{ {
m_availability = availability; m_availability = availability;
Q_ASSERT(m_availability <= 1.); Q_ASSERT(m_availability <= 1.);