Skip to content

Commit

Permalink
Small coding improvements (bis)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthieu Gallien <[email protected]>
Signed-off-by: m7913d <[email protected]>
  • Loading branch information
m7913d and mgallien committed Jul 14, 2023
1 parent a469a7a commit f56ae85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/gui/folder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/libsync/vfs/cfapi/vfs_cfapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Result<Vfs::ConvertToPlaceholderResult, QString> 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;
Expand Down

0 comments on commit f56ae85

Please sign in to comment.