mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
Fix placeholder detection for cfapi
Fixes: #8326 Signed-off-by: Matthieu Gallien <matthieu_gallien@yahoo.fr>
This commit is contained in:
parent
adb56178b9
commit
e04c6abcd5
1 changed files with 5 additions and 6 deletions
|
@ -885,16 +885,15 @@ void ProcessDirectoryJob::processFileAnalyzeLocalInfo(
|
|||
item->_type = localEntry.isDirectory ? ItemTypeDirectory : localEntry.isVirtualFile ? ItemTypeVirtualFile : ItemTypeFile;
|
||||
_childModified = true;
|
||||
|
||||
auto postProcessLocalNew = [item, localEntry, this]() {
|
||||
auto postProcessLocalNew = [item, localEntry, path, this]() {
|
||||
if (localEntry.isVirtualFile) {
|
||||
// Remove the spurious file if it looks like a placeholder file
|
||||
// (we know placeholder files contain " ", but only in the suffix case)
|
||||
if (localEntry.size <= 1 || !isVfsWithSuffix()) {
|
||||
qCWarning(lcDisco) << "Wiping virtual file without db entry for" << _currentFolder._local + "/" + localEntry.name;
|
||||
const bool isPlaceHolder = _discoveryData->_syncOptions._vfs->isDehydratedPlaceholder(_discoveryData->_localDir + path._local);
|
||||
if (isPlaceHolder) {
|
||||
qCWarning(lcDisco) << "Wiping virtual file without db entry for" << path._local;
|
||||
item->_instruction = CSYNC_INSTRUCTION_REMOVE;
|
||||
item->_direction = SyncFileItem::Down;
|
||||
} else {
|
||||
qCWarning(lcDisco) << "Virtual file without db entry for" << _currentFolder._local << localEntry.name
|
||||
qCWarning(lcDisco) << "Virtual file without db entry for" << path._local
|
||||
<< "but looks odd, keeping";
|
||||
item->_instruction = CSYNC_INSTRUCTION_IGNORE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue