Skip to content

Commit

Permalink
Iteration. Fixing tests.
Browse files Browse the repository at this point in the history
Signed-off-by: alex-z <[email protected]>
  • Loading branch information
allexzander committed Nov 13, 2023
1 parent 982df39 commit 111cf79
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/libsync/owncloudpropagator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,10 @@ void OwncloudPropagator::cleanupLocallyMovedFoldersFromNestedItems(SyncFileItemV
return false;
}

if (item->isDirectory()) {
return false;
}

// remove only children of previousFolderPath, not previousFolderPath itself such that parent always remains in the vector
return item->_originalFile.startsWith(previousFolderPath);
});
Expand Down Expand Up @@ -547,9 +551,31 @@ void OwncloudPropagator::start(SyncFileItemVector &&items)

// process each item that is new and is a directory and make sure every parent in its tree has the instruction NEW instead of REMOVE
adjustDeletedFoldersWithNewChildren(items);
qCInfo(lcPropagator) << "BEGIN ITEMS CLEANUP";
for (const auto &item : items) {
qCInfo(lcPropagator) << "item->_originalFile:"
<< item->_originalFile
<< "item->_renameTarget"
<< item->_renameTarget
<< "item->_direction"
<< item->_direction;
}

// when a folder is moved on the local device we only need to perform one MOVE on the server and then just update database, so we only keep unique moves (topmost moved folder items)
cleanupLocallyMovedFoldersFromNestedItems(items);
bool isCleanup = true;
if (isCleanup) {
cleanupLocallyMovedFoldersFromNestedItems(items);
}

qCInfo(lcPropagator) << "END ITEMS CLEANUP";
for (const auto &item : items) {
qCInfo(lcPropagator) << "item->_originalFile:"
<< item->_originalFile
<< "item->_renameTarget"
<< item->_renameTarget
<< "item->_direction"
<< item->_direction;
}

resetDelayedUploadTasks();
_rootJob.reset(new PropagateRootDirectory(this));
Expand Down

0 comments on commit 111cf79

Please sign in to comment.