Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2021-01-05 17:47:41 +0300
committerHannah von Reth <vonreth@kde.org>2021-01-05 19:46:23 +0300
commitad5e3b4fbb214cb323e41b0d30034960a2787cde (patch)
tree563919307ca5d3ef3ea741f335a045956b23b087
parentcf9afb8e9f3e512eec195821a3f5c3202ceb3c91 (diff)
Fix placeholder detection for cfapi
Fixes: #8326
-rw-r--r--changelog/unreleased/83266
-rw-r--r--src/libsync/discovery.cpp11
2 files changed, 11 insertions, 6 deletions
diff --git a/changelog/unreleased/8326 b/changelog/unreleased/8326
new file mode 100644
index 000000000..61280310b
--- /dev/null
+++ b/changelog/unreleased/8326
@@ -0,0 +1,6 @@
+Bugfix: Remove stray placeholders
+
+We fixed a bug where Windows Virtual Files where not handled as such and thus
+not removed.
+
+https://github.com/owncloud/client/issues/8326
diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp
index 2a2f279e4..b4f5f13dd 100644
--- a/src/libsync/discovery.cpp
+++ b/src/libsync/discovery.cpp
@@ -840,16 +840,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 " ")
- if (localEntry.size <= 1) {
- qCWarning(lcDisco) << "Wiping virtual file without db entry for" << _currentFolder._local + QLatin1Char('/') + 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;
}