diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-03-22 13:14:10 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-03-22 13:16:01 (GMT) |
commit | 6d1baf9979346d6f15da81a535becb4046278962 (patch) | |
tree | 634325ee7d0952c49c97f985527de1b312d472c7 | |
parent | 05639b335af810f8359e87213909e0ec16300635 (diff) | |
download | Qt-6d1baf9979346d6f15da81a535becb4046278962.zip Qt-6d1baf9979346d6f15da81a535becb4046278962.tar.gz Qt-6d1baf9979346d6f15da81a535becb4046278962.tar.bz2 |
Do not use FSEvents-based filesystemwatcher backend on Mac.
Removing the usage of FSEvents-based backend for now as it has a few bugs that
cannot be fixed right away. We will rewise it later and fallback to
kqueue-based backend for the moment.
Also added a test case that triggers a bug in the FSEvents file system watcher.
Reviewed-by: trustme
-rw-r--r-- | src/corelib/io/qfilesystemwatcher.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp | 25 |
2 files changed, 26 insertions, 1 deletions
diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp index 7223e49..00af3fd 100644 --- a/src/corelib/io/qfilesystemwatcher.cpp +++ b/src/corelib/io/qfilesystemwatcher.cpp @@ -248,7 +248,7 @@ QFileSystemWatcherEngine *QFileSystemWatcherPrivate::createNativeEngine() eng = QDnotifyFileSystemWatcherEngine::create(); return eng; #elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC) -# if defined(Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +# if 0 && defined(Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) return QFSEventsFileSystemWatcherEngine::create(); else diff --git a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp index 7138905..a26e34d 100644 --- a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp +++ b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp @@ -79,6 +79,8 @@ private slots: void nonExistingFile(); + void removeFileAndUnWatch(); + void cleanup(); private: QStringList do_force_engines; @@ -532,5 +534,28 @@ void tst_QFileSystemWatcher::nonExistingFile() QVERIFY(true); } +void tst_QFileSystemWatcher::removeFileAndUnWatch() +{ + static const char * const filename = "foo.txt"; + QFileSystemWatcher watcher; + + { + QFile testFile(filename); + testFile.open(QIODevice::WriteOnly); + testFile.close(); + } + watcher.addPath(filename); + + QFile::remove(filename); + watcher.removePath(filename); + + { + QFile testFile(filename); + testFile.open(QIODevice::WriteOnly); + testFile.close(); + } + watcher.addPath(filename); +} + QTEST_MAIN(tst_QFileSystemWatcher) #include "tst_qfilesystemwatcher.moc" |