From f56ae85604a9235f6af36665e9029387fa9a310c Mon Sep 17 00:00:00 2001 From: m7913d Date: Fri, 14 Jul 2023 10:11:32 +0200 Subject: [PATCH] Small coding improvements (bis) Co-authored-by: Matthieu Gallien Signed-off-by: m7913d --- src/gui/folder.cpp | 6 +++--- src/libsync/vfs/cfapi/vfs_cfapi.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 89652754f934a..664054a37f2ad 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -562,14 +562,14 @@ void Folder::slotWatchedPathChanged(const QString &path, ChangeReason reason) auto relativePath = path.midRef(this->path().size()); if (pathIsIgnored(path)) { - auto pinState = _vfs->pinState(relativePath.toString()); + const auto pinState = _vfs->pinState(relativePath.toString()); if (!pinState || *pinState != PinState::Excluded) { if (!_vfs->setPinState(relativePath.toString(), PinState::Excluded)) qCWarning(lcFolder) << "Could not set pin state of" << relativePath << "to excluded"; } return; } else { - auto pinState = _vfs->pinState(relativePath.toString()); + const auto pinState = _vfs->pinState(relativePath.toString()); if (pinState && *pinState == PinState::Excluded) { if (!_vfs->setPinState(relativePath.toString(), PinState::Inherited)) qCWarning(lcFolder) << "Could not switch pin state of" << relativePath << "from" << *pinState << "to inherited"; @@ -829,7 +829,7 @@ bool Folder::pathIsIgnored(const QString &path) const #ifndef OWNCLOUD_TEST if (isFileExcludedAbsolute(path) && !Utility::isConflictFile(path)) { - qCDebug(lcFolderWatcher) << "* Ignoring file" << path; + qCDebug(lcFolder) << "* Ignoring file" << path; return true; } #endif diff --git a/src/libsync/vfs/cfapi/vfs_cfapi.cpp b/src/libsync/vfs/cfapi/vfs_cfapi.cpp index a26d1b8b8f0df..9c32cc82937b1 100644 --- a/src/libsync/vfs/cfapi/vfs_cfapi.cpp +++ b/src/libsync/vfs/cfapi/vfs_cfapi.cpp @@ -228,7 +228,7 @@ Result VfsCfApi::convertToPlaceholder( if (item._type != ItemTypeDirectory && OCC::FileSystem::isLnkFile(filename)) { qCInfo(lcCfApi) << "File \"" << filename << "\" is a Windows shortcut. Not converting it to a placeholder."; - auto pinState = pinStateLocal(localPath); + const auto pinState = pinStateLocal(localPath); if (!pinState || *pinState != PinState::Excluded) setPinStateLocal(localPath, PinState::Excluded); return Vfs::ConvertToPlaceholderResult::Ok;