Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.4.2
-
None
-
Windows
Description
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!!! }
Attachments
Issue Links
- relates to
-
QTBUG-10846 QFileSystemWatcher cannot removePath() on files from watched directory
- Closed
-
QTBUG-80965 Calling QFileSystemModel::remove results in QFileSystemWatcher::removePaths: list is empty
- Closed