]> dgit.raspbian.org Git - nextcloud-desktop.git/commit
[overlays] Fix folders appearing as OK even though children are still syncing #4797
authorJocelyn Turcotte <jturcotte@woboq.com>
Fri, 5 Aug 2016 10:12:01 +0000 (12:12 +0200)
committerJocelyn Turcotte <jturcotte@woboq.com>
Wed, 17 Aug 2016 13:40:02 +0000 (15:40 +0200)
commitefb6b8c2c9a8dd3f25f6ddb5f67701f28ec7440a
treed7d15d4db5784b76eaf9d4ce92f14978fd34394a
parente974771796ec6ef9ddae2e1cdd512ccb08ca825d
[overlays] Fix folders appearing as OK even though children are still syncing #4797

This would happen if the directory would first need to be created
through an mkdir propagation job. This job's itemCompleted signal
would trigger the directory to show as SYNC even though its children
are still propagating.

Fix the issue by tracking the sync count for each file, affecting
its parents. This allows us to get rid of the O(n) vector lookup
for each status query, and properly track the hierachical sync
status of a directory.

This also removes the itemCompleted signal emission from the
PropagateDirectory job. Since we only needed for overlay icons, and
since this job doesn't do any direct propagation, we can remove it
to ensure that we won't call itemCompleted twice for the item attached
to Propagate*Mkdir jobs (since the PropagateDirectory is backed by
the same SyncFileItem, instruction and status).
src/libsync/owncloudpropagator.cpp
src/libsync/syncengine.cpp
src/libsync/syncengine.h
src/libsync/syncfilestatustracker.cpp
src/libsync/syncfilestatustracker.h
test/testsyncfilestatustracker.cpp