mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 17:23:07 -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
|
@ -41,6 +41,7 @@
|
|||
#include <QVariantHash>
|
||||
|
||||
#include "../asyncfilestorage.h"
|
||||
#include "../global.h"
|
||||
#include "../logger.h"
|
||||
#include "../profile.h"
|
||||
#include "../settingsstorage.h"
|
||||
|
@ -283,7 +284,7 @@ void Session::load()
|
|||
void Session::loadFolder(const QJsonObject &jsonObj, Folder *folder)
|
||||
{
|
||||
bool updated = false;
|
||||
foreach (const QString &key, jsonObj.keys()) {
|
||||
for (const QString &key : copyAsConst(jsonObj.keys())) {
|
||||
const QJsonValue val {jsonObj[key]};
|
||||
if (val.isString()) {
|
||||
// previous format (reduced form) doesn't contain UID
|
||||
|
@ -355,7 +356,7 @@ void Session::loadLegacy()
|
|||
const QString parentFolderPath = Item::parentPath(legacyPath);
|
||||
const QString feedUrl = Item::relativeName(legacyPath);
|
||||
|
||||
foreach (const QString &folderPath, Item::expandPath(parentFolderPath))
|
||||
for (const QString &folderPath : copyAsConst(Item::expandPath(parentFolderPath)))
|
||||
addFolder(folderPath);
|
||||
|
||||
const QString feedPath = feedAliases[i].isEmpty()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue