From c775806a703d0c81f291922284fb7ba2b4e7444a Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Wed, 11 Sep 2024 17:14:11 +0200 Subject: [PATCH] avoid wrong tracking of renamed folders during discovery ensure server rename operations are tracked as server rename operations ensure local rename are tracked as local rename operations Signed-off-by: Matthieu Gallien --- src/libsync/discovery.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index ba24802cf2756..c1e4c788d3f93 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -1727,9 +1727,11 @@ void ProcessDirectoryJob::processFileFinalize( ASSERT(_dirItem && _dirItem->_instruction == CSYNC_INSTRUCTION_RENAME); // This is because otherwise subitems are not updated! (ideally renaming a directory could // update the database for all items! See PropagateDirectory::slotSubJobsFinished) - const auto adjustedOriginalPath = _discoveryData->adjustRenamedPath(path._original, SyncFileItem::Down); - Q_UNUSED(adjustedOriginalPath) - _discoveryData->_renamedItemsLocal.insert(path._original, path._target); + if (_dirItem->_direction == SyncFileItem::Direction::Down) { + _discoveryData->_renamedItemsRemote.insert(path._original, path._target); + } else { + _discoveryData->_renamedItemsLocal.insert(path._original, path._target); + } item->_instruction = CSYNC_INSTRUCTION_RENAME; item->_renameTarget = path._target; item->_direction = _dirItem->_direction;