From e1d7f7dfbc0191f585fde8695d315e3ffb98ccc5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 6 Jul 2017 12:38:31 +0200 Subject: QFileSystemWatcher/Windows: Recreate handle for files QWindowsFileSystemWatcherEngine uses one change notification per directory to watch directories or files within that directory. Adding files and their directories in a sequence caused the value in QWindowsFileSystemWatcherEngineThread::HandleForDirHash to be overwritten. Relax the check for the flags (watcher attributes) to use >= and recreate the change notification of a directory should its flags be insufficient. This triggers when a file is added after its directory since files require more attributes. Task-number: QTBUG-61792 Change-Id: I371a72f1934fa82c53aaf84beb907825031f1c81 Reviewed-by: Thiago Macieira --- tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp') diff --git a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp index 0ee7599b2c..154c7ec5bf 100644 --- a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp +++ b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp @@ -568,6 +568,10 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory() QCOMPARE(fileChangedSpy.count(), 0); QCOMPARE(dirChangedSpy.count(), 1); + // QTBUG-61792, removal should succeed (bug on Windows which uses one change + // notification per directory). + QVERIFY(watcher.removePath(testDir.absolutePath())); + QVERIFY(temporaryDir.rmdir(testDirName)); } -- cgit v1.2.3