tidy some loop related code: avoid one letter variable names
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Tue, 15 Nov 2022 10:52:25 +0000 (11:52 +0100)
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>
Fri, 18 Nov 2022 15:02:21 +0000 (16:02 +0100)
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/gui/folderman.cpp
test/testallfilesdeleted.cpp
test/testsyncconflict.cpp

index 98184ed3ca5a1ec7dfd62a78b3de9d8a5c008ea7..00312950738c2313be114574829387c997c66b2f 100644 (file)
@@ -1428,12 +1428,12 @@ void FolderMan::slotWipeFolderForAccount(AccountState *accountState)
 void FolderMan::setDirtyProxy()
 {
     const auto folderMapValues = _folderMap.values();
-    for (const Folder *f : folderMapValues) {
-        if (f) {
-            if (f->accountState() && f->accountState()->account()
-                && f->accountState()->account()->networkAccessManager()) {
+    for (const auto folder : folderMapValues) {
+        if (folder) {
+            if (folder->accountState() && folder->accountState()->account()
+                && folder->accountState()->account()->networkAccessManager()) {
                 // Need to do this so we do not use the old determined system proxy
-                f->accountState()->account()->networkAccessManager()->setProxy(
+                folder->accountState()->account()->networkAccessManager()->setProxy(
                     QNetworkProxy(QNetworkProxy::DefaultProxy));
             }
         }
@@ -1443,10 +1443,10 @@ void FolderMan::setDirtyProxy()
 void FolderMan::setDirtyNetworkLimits()
 {
     const auto folderMapValues = _folderMap.values();
-    for (Folder *f : folderMapValues) {
+    for (auto folder : folderMapValues) {
         // set only in busy folders. Otherwise they read the config anyway.
-        if (f && f->isBusy()) {
-            f->setDirtyNetworkLimits();
+        if (folder && folder->isBusy()) {
+            folder->setDirtyNetworkLimits();
         }
     }
 }
index 90b8a1eba285f549772916ced0064a37fa649952..e3e3de50c2435a1f7e0dd7024ed481fa96c218fd 100644 (file)
@@ -71,8 +71,8 @@ private slots:
 
         auto &modifier = deleteOnRemote ? fakeFolder.remoteModifier() : fakeFolder.localModifier();
         const auto childrenKeys = fakeFolder.currentRemoteState().children.keys();
-        for (const auto &s : childrenKeys) {
-            modifier.remove(s);
+        for (const auto &key : childrenKeys) {
+            modifier.remove(key);
         }
 
         QVERIFY(!fakeFolder.syncOnce()); // Should fail because we cancel the sync
@@ -113,8 +113,8 @@ private slots:
 
         auto &modifier = deleteOnRemote ? fakeFolder.remoteModifier() : fakeFolder.localModifier();
         const auto childrenKeys = fakeFolder.currentRemoteState().children.keys();
-        for (const auto &s : childrenKeys) {
-            modifier.remove(s);
+        for (const auto &key : childrenKeys) {
+            modifier.remove(key);
         }
 
         QVERIFY(fakeFolder.syncOnce()); // Should succeed, and all files must then be deleted
index 2d78aad968a457962db8bcceebb15d01044955c7..a12b47645610a2e756b6b048047d0e289946a42d 100644 (file)
@@ -80,8 +80,8 @@ private slots:
 
         // Verify that the conflict names don't have the user name
         const auto conflicts = findConflicts(fakeFolder.currentLocalState().children["A"]);
-        for (const auto &name : conflicts) {
-            QVERIFY(!name.contains(fakeFolder.syncEngine().account()->davDisplayName()));
+        for (const auto &conflict : conflicts) {
+            QVERIFY(!conflict.contains(fakeFolder.syncEngine().account()->davDisplayName()));
         }
 
         QVERIFY(expectAndWipeConflict(fakeFolder.localModifier(), fakeFolder.currentLocalState(), "A/a1"));