Windows shell integration: Add SHCNF_FLUSHNOWAIT to SHChangeNotify

(TortoiseSVN have this flag)

Also do not call SHChangeNotify if there was no change
This commit is contained in:
Olivier Goffart 2014-10-21 14:51:18 +02:00
parent 5a109d9293
commit 98c5871d38

View file

@ -113,10 +113,15 @@ void RemotePathChecker::workerThreadLoop()
auto state = _StrToFileState(responseStatus);
auto erased = asked.erase(responsePath);
bool changed = false;
{ std::unique_lock<std::mutex> lock(_mutex);
_cache[responsePath] = state;
auto &it = _cache[responsePath];
changed = it == state;
it = state;
}
if (changed) {
SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT, responsePath.data(), NULL);
}
SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH, responsePath.data(), NULL);
}
}