mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-11 07:46:17 -07:00
Convert all foreach() to range-based for()
This commit is contained in:
parent
d668a4fe6d
commit
6b1d26d555
64 changed files with 326 additions and 292 deletions
|
@ -32,6 +32,7 @@
|
|||
#include "base/bittorrent/session.h"
|
||||
#include "base/bittorrent/sessionstatus.h"
|
||||
#include "base/bittorrent/torrenthandle.h"
|
||||
#include "base/global.h"
|
||||
#include "base/utils/misc.h"
|
||||
#include "base/utils/string.h"
|
||||
#include "ui_statsdialog.h"
|
||||
|
@ -89,7 +90,7 @@ void StatsDialog::update()
|
|||
|
||||
// num_peers is not reliable (adds up peers, which didn't even overcome tcp handshake)
|
||||
quint32 peers = 0;
|
||||
foreach (BitTorrent::TorrentHandle *const torrent, BitTorrent::Session::instance()->torrents())
|
||||
for (BitTorrent::TorrentHandle *const torrent : copyAsConst(BitTorrent::Session::instance()->torrents()))
|
||||
peers += torrent->peersCount();
|
||||
|
||||
m_ui->labelWriteStarve->setText(QString("%1%")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue