[Pkg-owncloud-commits] [owncloud-client] 01/175: shell_integration on Windows: Don't fill the cache with unsolicited statuses #3122
Sandro Knauß
hefee-guest at moszumanska.debian.org
Sat Aug 8 10:36:19 UTC 2015
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit 77679790dbcb51f1cf524ee2c737ee19fc63eb49
Author: Jocelyn Turcotte <jturcotte at woboq.com>
Date: Wed May 6 15:51:41 2015 +0200
shell_integration on Windows: Don't fill the cache with unsolicited statuses #3122
Only keep the status updates if explorer is going to display it.
---
shell_integration/windows/OCUtil/RemotePathChecker.cpp | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/shell_integration/windows/OCUtil/RemotePathChecker.cpp b/shell_integration/windows/OCUtil/RemotePathChecker.cpp
index 161163d..0dda646 100644
--- a/shell_integration/windows/OCUtil/RemotePathChecker.cpp
+++ b/shell_integration/windows/OCUtil/RemotePathChecker.cpp
@@ -115,13 +115,16 @@ void RemotePathChecker::workerThreadLoop()
auto responseStatus = response.substr(statusBegin+1, statusEnd - statusBegin-1);
auto responsePath = response.substr(statusEnd+1);
auto state = _StrToFileState(responseStatus);
- auto erased = asked.erase(responsePath);
+ bool wasAsked = asked.erase(responsePath) > 0;
bool changed = false;
{ std::unique_lock<std::mutex> lock(_mutex);
- auto &it = _cache[responsePath];
- changed = (it != state);
- it = state;
+ bool wasCached = _cache.find(responsePath) != _cache.end();
+ if (wasAsked || wasCached) {
+ auto &it = _cache[responsePath];
+ changed = (it != state);
+ it = state;
+ }
}
if (changed) {
SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT, responsePath.data(), NULL);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list