Skip to content

Commit

Permalink
fix code style
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu Gallien <[email protected]>
  • Loading branch information
mgallien authored and backportbot[bot] committed Jan 3, 2025
1 parent 4375f7d commit 463114e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/libsync/discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2205,20 +2205,24 @@ void ProcessDirectoryJob::setupDbPinStateActions(SyncJournalFileRecord &record)
{
// Only suffix-vfs uses the db for pin states.
// Other plugins will set localEntry._type according to the file's pin state.
if (!isVfsWithSuffix())
if (!isVfsWithSuffix()) {
return;
}

auto pin = _discoveryData->_statedb->internalPinStates().rawForPath(record._path);
if (!pin || *pin == PinState::Inherited)
if (!pin || *pin == PinState::Inherited) {
pin = _pinState;
}

// OnlineOnly hydrated files want to be dehydrated
if (record._type == ItemTypeFile && *pin == PinState::OnlineOnly)
if (record._type == ItemTypeFile && *pin == PinState::OnlineOnly) {
record._type = ItemTypeVirtualFileDehydration;
}

// AlwaysLocal dehydrated files want to be hydrated
if (record._type == ItemTypeVirtualFile && *pin == PinState::AlwaysLocal)
if (record._type == ItemTypeVirtualFile && *pin == PinState::AlwaysLocal) {
record._type = ItemTypeVirtualFileDownload;
}
}

}

0 comments on commit 463114e

Please sign in to comment.