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

It would be nice if QFileSystemWatcher emitted more specific signals

XMLWordPrintable

      Currently, QFileSystemWatcher only emits fileChanged and directoryChanged. In many cases those are too generic.

      E.g. consider the scenario where an image viewer application needs to refresh the image whenever it is modified by an external application (e.g. Gimp). With QFileSystemWatcher one will get lots of fileChanged signals (because the file is saved in chunks) and there's no convenient way of detecting whether the image is saved, deleted, renamed, ..., or moved.

      QFileSystemWatcher::fileWritten(const QString &path) would have been neat in this particular case.
      (Implemented based on Inotify: IN_CLOSE_WRITE, dnotify: DN_MODIFY, kqueue: NOTE_WRITE, win: FILE_NOTIFY_CHANGE_LAST_WRITE).

      And the same goes for QFileSystemWatcher::fileMoved/Deleted/Renamed, +++

      Additionally, it would have been nice if I could tell QFileSystemWatcher to only listen for a certain types of events.

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

            w00t Robin Burchell
            bjnilsen Bjørn Erik Nilsen
            Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes