mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 00:33:09 -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
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include <QJsonArray>
|
||||
|
||||
#include "base/global.h"
|
||||
#include "base/logger.h"
|
||||
#include "base/utils/string.h"
|
||||
|
||||
|
@ -71,7 +72,7 @@ void LogController::mainAction()
|
|||
Logger *const logger = Logger::instance();
|
||||
QVariantList msgList;
|
||||
|
||||
foreach (const Log::Msg &msg, logger->getMessages(lastKnownId)) {
|
||||
for (const Log::Msg &msg : copyAsConst(logger->getMessages(lastKnownId))) {
|
||||
if (!((msg.type == Log::NORMAL && isNormal)
|
||||
|| (msg.type == Log::INFO && isInfo)
|
||||
|| (msg.type == Log::WARNING && isWarning)
|
||||
|
@ -110,7 +111,7 @@ void LogController::peersAction()
|
|||
Logger *const logger = Logger::instance();
|
||||
QVariantList peerList;
|
||||
|
||||
foreach (const Log::Peer &peer, logger->getPeers(lastKnownId)) {
|
||||
for (const Log::Peer &peer : copyAsConst(logger->getPeers(lastKnownId))) {
|
||||
QVariantMap map;
|
||||
map[KEY_LOG_ID] = peer.id;
|
||||
map[KEY_LOG_TIMESTAMP] = peer.timestamp;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue