Skip to content

Commit

Permalink
tidy some loop related code: avoid one letter variable names
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
  • Loading branch information
mgallien committed Nov 15, 2022
1 parent 07c563a commit af55075
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions src/gui/folderman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1426,12 +1426,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));
}
}
Expand All @@ -1441,10 +1441,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();
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions test/testallfilesdeleted.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/testsyncconflict.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down

0 comments on commit af55075

Please sign in to comment.