Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-8945 QFileSystemWatcher should notify when files are modified in a watched directory
  3. QTBUG-3576

Unix/Linux: QFileSystemWatcher with Inotify doesn't detect modified files

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Invalid
    • P3: Somewhat important
    • Some future release
    • Core: I/O
    • None
    • Linux

    Description

      With the following example below, echo "foobar" > 1 into the directory does not cause QFileSystemWatcher to emit directoryChanged.

      #include <QtGui>
      
      class Object : public QObject
      {
          Q_OBJECT
      public:
          Object() : QObject()
          {
              QFileSystemWatcher *watcher = new QFileSystemWatcher(this);
              watcher->addPath(QDir::current().absolutePath());
              connect(watcher, SIGNAL(directoryChanged(const QString &)), this,
                      SLOT(onDirModified(const QString &)));
          }
      
      public slots:
          void onDirModified(const QString &path)
          {
              qDebug() << path;
          }
      };
      
      #include "main.moc"
      
      int main(int argc, char **argv)
      {
          QCoreApplication a(argc, argv);
          Object o;
          return a.exec();
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              w00t Robin Burchell
              mch Jervey Kong
              Votes:
              4 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes