diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2010-11-26 09:11:15 (GMT) |
---|---|---|
committer | João Abecasis <joao.abecasis@nokia.com> | 2010-11-26 16:42:00 (GMT) |
commit | 4e6cc34b75fd42d663ced0f3da1c9a9a6950fb6f (patch) | |
tree | 80e3540450ba687766d45b47c19411f13cb6b97a /tests/auto/qfilesystemwatcher | |
parent | 5784daa662e1ace86e6046bf369e9029d57c32d8 (diff) | |
download | Qt-4e6cc34b75fd42d663ced0f3da1c9a9a6950fb6f.zip Qt-4e6cc34b75fd42d663ced0f3da1c9a9a6950fb6f.tar.gz Qt-4e6cc34b75fd42d663ced0f3da1c9a9a6950fb6f.tar.bz2 |
QKqueueFileSystemWatcher: don't stop thread that isn't running
When removing paths from the watch list, if we end up with an empty
watch list, we would send a request to the processing thread to quit.
In the case where the watch list was empty to begin with (the paths
being removed weren't actually being watched) the request to quit would
still be queued. If the processing thread wasn't running (and it
shouldn't if there weren't any paths being watched) the request to quit
would still be posted but not processed.
The next time paths were added and the thread started, the request would
be processed and the thread would quit at once.
When removing paths from the list, we now check whether the watch list
is empty to begin with and exit early without asking the processing
thread to quit itself.
Task-Number: QTBUG-14435
Reviewed-by: Bradley T. Hughes
Diffstat (limited to 'tests/auto/qfilesystemwatcher')
-rw-r--r-- | tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp index 3ed93fa..1feaced 100644 --- a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp +++ b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp @@ -135,6 +135,7 @@ void tst_QFileSystemWatcher::basicTest() // create watcher, forcing it to use a specific backend QFileSystemWatcher watcher; watcher.setObjectName(QLatin1String("_qt_autotest_force_engine_") + backend); + watcher.removePath(testFile.fileName()); watcher.addPath(testFile.fileName()); QSignalSpy changedSpy(&watcher, SIGNAL(fileChanged(const QString &))); |