diff options
author | Robin Burchell <robin.burchell@collabora.com> | 2011-12-27 18:24:57 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-02 18:19:36 +0100 |
commit | d4514b63c7297dad8ca6710d71bee4db4431d6dc (patch) | |
tree | a6c3ac34fc09b52df495d31889d7af3c5ab81115 /src/corelib/io/qfilesystemwatcher.cpp | |
parent | 9fbfddfe8afe7a73b1136f20211da7274217b9e1 (diff) |
Remove support for dnotify QFileSystemWatcher.
Inotify has been available in Linux for some ~6 years now, 7 when Qt 5 will
actually be released, so I'd say it's safe to remove this fallback path now,
particularly as the autotest notes that it's broken.
Change-Id: I49dbb161d4765d63e92f512a6375323c7d37ccbe
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'src/corelib/io/qfilesystemwatcher.cpp')
-rw-r--r-- | src/corelib/io/qfilesystemwatcher.cpp | 51 |
1 files changed, 4 insertions, 47 deletions
diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp index 302b6e5b06..efa9029d56 100644 --- a/src/corelib/io/qfilesystemwatcher.cpp +++ b/src/corelib/io/qfilesystemwatcher.cpp @@ -56,7 +56,6 @@ # include "qfilesystemwatcher_win_p.h" #elif defined(Q_OS_LINUX) # include "qfilesystemwatcher_inotify_p.h" -# include "qfilesystemwatcher_dnotify_p.h" #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) # include "qfilesystemwatcher_fsevents_p.h" @@ -247,10 +246,9 @@ QFileSystemWatcherEngine *QFileSystemWatcherPrivate::createNativeEngine() #if defined(Q_OS_WIN) return new QWindowsFileSystemWatcherEngine; #elif defined(Q_OS_LINUX) - QFileSystemWatcherEngine *eng = QInotifyFileSystemWatcherEngine::create(); - if(!eng) - eng = QDnotifyFileSystemWatcherEngine::create(); - return eng; + // there is a chance that inotify may fail on Linux pre-2.6.13 (August + // 2005), so we can't just new inotify directly. + return QInotifyFileSystemWatcherEngine::create(); #elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC) # 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) @@ -264,7 +262,7 @@ QFileSystemWatcherEngine *QFileSystemWatcherPrivate::createNativeEngine() } QFileSystemWatcherPrivate::QFileSystemWatcherPrivate() - : native(0), poller(0), forced(0) + : native(0), poller(0) { } @@ -284,35 +282,6 @@ void QFileSystemWatcherPrivate::init() } } -void QFileSystemWatcherPrivate::initForcedEngine(const QString &forceName) -{ - if(forced) - return; - - Q_Q(QFileSystemWatcher); - -#if defined(Q_OS_LINUX) - if(forceName == QLatin1String("inotify")) { - forced = QInotifyFileSystemWatcherEngine::create(); - } else if(forceName == QLatin1String("dnotify")) { - forced = QDnotifyFileSystemWatcherEngine::create(); - } -#else - Q_UNUSED(forceName); -#endif - - if(forced) { - QObject::connect(forced, - SIGNAL(fileChanged(QString,bool)), - q, - SLOT(_q_fileChanged(QString,bool))); - QObject::connect(forced, - SIGNAL(directoryChanged(QString,bool)), - q, - SLOT(_q_directoryChanged(QString,bool))); - } -} - void QFileSystemWatcherPrivate::initPollerEngine() { if(poller) @@ -444,12 +413,6 @@ QFileSystemWatcher::~QFileSystemWatcher() delete d->poller; d->poller = 0; } - if (d->forced) { - d->forced->stop(); - d->forced->wait(); - delete d->forced; - d->forced = 0; - } } /*! @@ -526,10 +489,6 @@ void QFileSystemWatcher::addPaths(const QStringList &paths) } else if(forceName == QLatin1String("native")) { qDebug() << "QFileSystemWatcher: skipping polling engine, using only native engine"; engine = d->native; - } else { - qDebug() << "QFileSystemWatcher: skipping polling and native engine, using only explicit" << forceName << "engine"; - d_func()->initForcedEngine(forceName); - engine = d->forced; } } @@ -572,8 +531,6 @@ void QFileSystemWatcher::removePaths(const QStringList &paths) p = d->native->removePaths(p, &d->files, &d->directories); if (d->poller) p = d->poller->removePaths(p, &d->files, &d->directories); - if (d->forced) - p = d->forced->removePaths(p, &d->files, &d->directories); } /*! |