mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 09:30:13 +03:00
Fix review comments.
Signed-off-by: allexzander <blackslayer4@gmail.com>
This commit is contained in:
parent
6ce5279b6c
commit
99f6e82290
1 changed files with 5 additions and 5 deletions
|
@ -916,24 +916,24 @@ void ProcessDirectoryJob::processFileAnalyzeLocalInfo(
|
|||
const bool isFilePlaceHolder = !localEntry.isDirectory && _discoveryData->_syncOptions._vfs->isDehydratedPlaceholder(_discoveryData->_localDir + path._local);
|
||||
|
||||
// either correct availability, or a result with error if the folder is new or otherwise has no availability set yet
|
||||
const auto folderAvailability = localEntry.isDirectory ? _discoveryData->_syncOptions._vfs->availability(path._local) : Vfs::AvailabilityResult(Vfs::AvailabilityError::NoSuchItem);
|
||||
const auto folderPlaceHolderAvailability = localEntry.isDirectory ? _discoveryData->_syncOptions._vfs->availability(path._local) : Vfs::AvailabilityResult(Vfs::AvailabilityError::NoSuchItem);
|
||||
|
||||
const auto folderPinState = localEntry.isDirectory ? _discoveryData->_syncOptions._vfs->pinState(path._local) : Optional<PinStateEnums::PinState>(PinState::Unspecified);
|
||||
|
||||
if (!isFilePlaceHolder && !folderAvailability.isValid() && !folderPinState.isValid()) {
|
||||
if (!isFilePlaceHolder && !folderPlaceHolderAvailability.isValid() && !folderPinState.isValid()) {
|
||||
// not a file placeholder and not a synced folder placeholder (new local folder)
|
||||
return;
|
||||
}
|
||||
|
||||
const auto isFolderPinStateOnlineOnly = (folderPinState.isValid() && *folderPinState == PinState::OnlineOnly);
|
||||
|
||||
const auto isFolderAvailabilityOnlineOnly = (folderAvailability.isValid() && *folderAvailability == VfsItemAvailability::OnlineOnly);
|
||||
const auto isfolderPlaceHolderAvailabilityOnlineOnly = (folderPlaceHolderAvailability.isValid() && *folderPlaceHolderAvailability == VfsItemAvailability::OnlineOnly);
|
||||
|
||||
// a folder is considered online-only if: no files are hydrated, or, if it's an empty folder
|
||||
const auto isOnlineOnlyFolder = isFolderAvailabilityOnlineOnly || !folderAvailability && isFolderPinStateOnlineOnly;
|
||||
const auto isOnlineOnlyFolder = isfolderPlaceHolderAvailabilityOnlineOnly || !folderPlaceHolderAvailability && isFolderPinStateOnlineOnly;
|
||||
|
||||
if (!isFilePlaceHolder && !isOnlineOnlyFolder) {
|
||||
if (localEntry.isDirectory && folderAvailability.isValid() && !isOnlineOnlyFolder) {
|
||||
if (localEntry.isDirectory && folderPlaceHolderAvailability.isValid() && !isOnlineOnlyFolder) {
|
||||
// a VFS folder but is not online0only (has some files hydrated)
|
||||
qCInfo(lcDisco) << "Virtual directory without db entry for" << path._local << "but it contains hydrated file(s), so let's keep it and reupload.";
|
||||
emit _discoveryData->addErrorToGui(SyncFileItem::SoftError, tr("Conflict when uploading some files to a folder. Those, conflicted, are going to get cleared!"), path._local);
|
||||
|
|
Loading…
Reference in a new issue