Don't keep the list of touched files for the whole sync
authorJocelyn Turcotte <jturcotte@woboq.com>
Mon, 24 Jul 2017 06:03:05 +0000 (08:03 +0200)
committerJocelyn Turcotte <jturcotte@woboq.com>
Mon, 24 Jul 2017 15:54:29 +0000 (17:54 +0200)
commita41dc00160f1a2510ab71cfcff9ef0c61ff3f6e8
tree52eb9187772f6398eb1acc45d3ee942124228eec
parent5a1bf7d8feb1900fd93ca4f9c613cef4c9cbff93
Don't keep the list of touched files for the whole sync

We only want to know if they were touched within the last 15 seconds,
so change the data structure to use a QMultiMap, and sort them by
QElapsedTimer. This allows us to iterate over old entries ordered by
time and to stop once we find a recent entry.

This makes the look-up slower but in most cases the folder watcher
will report any change within milliseconds, and we start from the
most recent. What this really makes slower are actual user file
changes while a fast sync is underways which will need to iterate
over the whole map to find out the file isn't there.

This reduces the growth of the memory usage when downloading a large
amount of files.
src/gui/folder.cpp
src/libsync/syncengine.cpp
src/libsync/syncengine.h