Skip to content

Commit

Permalink
Small coding improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Dries Mys <[email protected]>
  • Loading branch information
m7913d committed Jul 19, 2023
1 parent d351a0c commit 4bd4c02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/gui/folder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,15 +564,17 @@ void Folder::slotWatchedPathChanged(const QString &path, ChangeReason reason)
if (pathIsIgnored(path)) {
const auto pinState = _vfs->pinState(relativePath.toString());
if (!pinState || *pinState != PinState::Excluded) {
if (!_vfs->setPinState(relativePath.toString(), PinState::Excluded))
if (!_vfs->setPinState(relativePath.toString(), PinState::Excluded)) {
qCWarning(lcFolder) << "Could not set pin state of" << relativePath << "to excluded";
}
}
return;
} else {
const auto pinState = _vfs->pinState(relativePath.toString());
if (pinState && *pinState == PinState::Excluded) {
if (!_vfs->setPinState(relativePath.toString(), PinState::Inherited))
if (!_vfs->setPinState(relativePath.toString(), PinState::Inherited)) {
qCWarning(lcFolder) << "Could not switch pin state of" << relativePath << "from" << *pinState << "to inherited";
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/libsync/vfs/cfapi/vfs_cfapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,9 @@ 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.";
const auto pinState = pinStateLocal(localPath);
if (!pinState || *pinState != PinState::Excluded)
if (!pinState || *pinState != PinState::Excluded) {
setPinStateLocal(localPath, PinState::Excluded);
}
return Vfs::ConvertToPlaceholderResult::Ok;
}

Expand Down

0 comments on commit 4bd4c02

Please sign in to comment.