summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/io/qfilesystemwatcher.cpp2
-rw-r--r--tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp25
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"