-
Type:
Bug
-
Status: Reported
-
Priority:
P2: Important
-
Resolution: Unresolved
-
Affects Version/s: 5.4.2
-
Fix Version/s: None
-
Component/s: Core: Filesystem watching
-
Labels:None
-
Environment:Windows
if you add two or more files to QFileSystemWatcher, and then remove any file it will return false.
But if you add single file and then remove them - removePath will return true;
the reazon is here:
qfilesystemwatcher_win.cpp
Bar.java
//create handle if (handle.handle != INVALID_HANDLE_VALUE) { QWindowsFileSystemWatcherEngineThread::PathInfoHash &h = thread->pathInfoForHandle[handle.handle]; //hash "h" contains all wathed files!!! not only removed file if (h.remove(QFileSystemWatcherPathKey(fileInfo.absoluteFilePath()))) { files->removeAll(path); directories->removeAll(path); if (h.isEmpty()) { //Warning: h is not empty! It contain other watched files! DEBUG() << "Closing handle" << handle.handle; ... //do some work it.remove(); //error: we removes iterator only if h no contains other files!!! }