SyncEngine: Fix renaming of folder when file are changed (#5195)
authorOlivier Goffart <olivier@woboq.com>
Thu, 22 Sep 2016 07:02:47 +0000 (09:02 +0200)
committerGitHub <noreply@github.com>
Thu, 22 Sep 2016 07:02:47 +0000 (09:02 +0200)
commit85b8ab178e21cf4dcaf792f68c15e55f6e0ee3c2
treeea71f625393b624faed61072c87ec5ac62a8ff27
parentea9d17b41d38def0588ef638b5f5aef5711fd4ba
SyncEngine: Fix renaming of folder when file are changed (#5195)

Two bugs:
 - The change filed are not considered as move, they are re-downloaded
   but the old file was not removed from the database. The change in
   owncloudpropagator.cpp takes care of removing the old entries.

 - Next sync would then remove the file in the server in the old folder
   This was not a problem until we start reusing the sync engine, and
   that the _renamedFolders map is not cleared. We were before deleting
   a non-existing file. But now we delete the actual file.

Also improve the tests to be able to do move on the server.
This include support for file id.

Issue #5192
src/libsync/owncloudpropagator.cpp
src/libsync/syncengine.cpp
test/syncenginetestutils.h
test/testsyncengine.cpp