diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2012-01-12 11:40:51 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-12 14:38:18 +0100 |
commit | 9834b3681fb02ef5eaab19d678b674365a4381e4 (patch) | |
tree | 70b2d8beea25698909a146b2dec5b6e23e74a2fa /src/corelib/io/qfilesystemwatcher_kqueue.cpp | |
parent | 716905cd5675497f0c99e9468bc52ed6e6e25005 (diff) |
Make QFileSystemWatcherEngines children of QFileSystemWatcher
To support moving QFileSystemWatcher to another thread, the engines need
to follow when the watcher is moved. The easiest way to do this is by
parenting the engines to the watcher.
Change-Id: Ie2bb701c0c148da9cc2302d4de23286b8ef42c4d
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qfilesystemwatcher_kqueue.cpp')
-rw-r--r-- | src/corelib/io/qfilesystemwatcher_kqueue.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/corelib/io/qfilesystemwatcher_kqueue.cpp b/src/corelib/io/qfilesystemwatcher_kqueue.cpp index 8070af5e18..fd7bfa2b27 100644 --- a/src/corelib/io/qfilesystemwatcher_kqueue.cpp +++ b/src/corelib/io/qfilesystemwatcher_kqueue.cpp @@ -67,17 +67,18 @@ QT_BEGIN_NAMESPACE # define DEBUG if(false)qDebug #endif -QKqueueFileSystemWatcherEngine *QKqueueFileSystemWatcherEngine::create() +QKqueueFileSystemWatcherEngine *QKqueueFileSystemWatcherEngine::create(QObject *parent) { int kqfd = kqueue(); if (kqfd == -1) return 0; - return new QKqueueFileSystemWatcherEngine(kqfd); + return new QKqueueFileSystemWatcherEngine(kqfd, parent); } -QKqueueFileSystemWatcherEngine::QKqueueFileSystemWatcherEngine(int kqfd) - : kqfd(kqfd) - , notifier(kqfd, QSocketNotifier::Read, this) +QKqueueFileSystemWatcherEngine::QKqueueFileSystemWatcherEngine(int kqfd, QObject *parent) + : QFileSystemWatcherEngine(parent), + kqfd(kqfd), + notifier(kqfd, QSocketNotifier::Read, this) { connect(¬ifier, SIGNAL(activated(int)), SLOT(readFromKqueue())); |