Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-49411

QFileSystemWatcher::removePath return false but remove file successfuly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.4.2
    • None
    • 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!!! 
                         }
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            thiago Thiago Macieira
            ctin Konstantin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes