mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 05:08:05 -06:00
Use range-based for loops
This commit is contained in:
@@ -1174,10 +1174,8 @@ QBitArray TorrentHandle::downloadingPieces() const
|
||||
std::vector<lt::partial_piece_info> queue;
|
||||
m_nativeHandle.get_download_queue(queue);
|
||||
|
||||
std::vector<lt::partial_piece_info>::const_iterator it = queue.begin();
|
||||
std::vector<lt::partial_piece_info>::const_iterator itend = queue.end();
|
||||
for (; it != itend; ++it)
|
||||
result.setBit(it->piece_index);
|
||||
for (const lt::partial_piece_info &info : queue)
|
||||
result.setBit(info.piece_index);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ void ScanFoldersModel::configure()
|
||||
{
|
||||
const QVariantHash dirs = Preferences::instance()->getScanDirs();
|
||||
|
||||
for (QVariantHash::const_iterator i = dirs.begin(), e = dirs.end(); i != e; ++i) {
|
||||
for (auto i = dirs.cbegin(); i != dirs.cend(); ++i) {
|
||||
if (i.value().type() == QVariant::Int)
|
||||
addPath(i.key(), static_cast<PathType>(i.value().toInt()), QString());
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user