Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJocelyn Turcotte <jturcotte@woboq.com>2017-07-24 09:03:05 +0300
committerJocelyn Turcotte <jturcotte@woboq.com>2017-07-24 18:54:29 +0300
commita41dc00160f1a2510ab71cfcff9ef0c61ff3f6e8 (patch)
tree52eb9187772f6398eb1acc45d3ee942124228eec /src/gui/folder.cpp
parent5a1bf7d8feb1900fd93ca4f9c613cef4c9cbff93 (diff)
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.
Diffstat (limited to 'src/gui/folder.cpp')
-rw-r--r--src/gui/folder.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp
index f5e23c88b..4ca5de844 100644
--- a/src/gui/folder.cpp
+++ b/src/gui/folder.cpp
@@ -459,9 +459,8 @@ void Folder::slotWatchedPathChanged(const QString &path)
// own process. Therefore nothing needs to be done here!
#else
// Use the path to figure out whether it was our own change
- const auto maxNotificationDelay = 15 * 1000;
- qint64 time = _engine->timeSinceFileTouched(path);
- if (time != -1 && time < maxNotificationDelay) {
+ if (_engine->wasFileTouched(path)) {
+ qCDebug(lcFolder) << "Changed path was touched by SyncEngine, ignoring:" << path;
return;
}
#endif