Sfoglia il codice sorgente

tidy some loop related code: avoid one letter variable names

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Matthieu Gallien 3 anni fa
parent
commit
26fd4d2226
3 ha cambiato i file con 14 aggiunte e 14 eliminazioni
  1. 8 8
      src/gui/folderman.cpp
  2. 4 4
      test/testallfilesdeleted.cpp
  3. 2 2
      test/testsyncconflict.cpp

+ 8 - 8
src/gui/folderman.cpp

@@ -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();
         }
     }
 }

+ 4 - 4
test/testallfilesdeleted.cpp

@@ -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

+ 2 - 2
test/testsyncconflict.cpp

@@ -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"));