From: Christian Kamm Date: Mon, 12 Nov 2018 11:23:22 +0000 (+0100) Subject: vfs: Allow remote renames to propagate as such X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~402 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=90827c8162475fd812b69baa9131fb81783807d8;p=nextcloud-desktop.git vfs: Allow remote renames to propagate as such --- diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 8d1854931..c059c7393 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -460,12 +460,6 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo( // Now we know there is a sane rename candidate. QString originalPath = QString::fromUtf8(base._path); - // Rename of a virtual file - if (base.isVirtualFile() && item->_type == ItemTypeFile) { - // Ignore if the base is a virtual files - return; - } - if (_discoveryData->_renamedItems.contains(originalPath)) { qCInfo(lcDisco, "folder already has a rename entry, skipping"); return; @@ -480,12 +474,14 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo( return; } - if (!item->isDirectory()) { + if (!base.isDirectory()) { csync_file_stat_t buf; if (csync_vio_local_stat((_discoveryData->_localDir + originalPath).toUtf8(), &buf)) { qCInfo(lcDisco) << "Local file does not exist anymore." << originalPath; return; } + // NOTE: This prohibits some VFS renames from being detected since + // suffix-file size is different from the db size. That's ok, they'll DELETE+NEW. if (buf.modtime != base._modtime || buf.size != base._fileSize || buf.type == ItemTypeDirectory) { qCInfo(lcDisco) << "File has changed locally, not a rename." << originalPath; return; @@ -497,6 +493,11 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo( } } + // Renames of virtuals are possible + if (base.isVirtualFile()) { + item->_type = ItemTypeVirtualFile; + } + bool wasDeletedOnServer = _discoveryData->findAndCancelDeletedJob(originalPath).first; auto postProcessRename = [this, item, base, originalPath](PathTuple &path) {