summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas McGuire <thomas.mcguire.qnx@kdab.com>2012-10-25 10:04:53 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-30 16:32:54 (GMT)
commit09264c709ea68e585c1f8c479095ebf8420e6e11 (patch)
tree2d975dad6f8904effe5cff5c5d8f129c52d9a667 /src
parent88be388557cb164eff3436973a57ba5914f4ad3b (diff)
downloadQt-09264c709ea68e585c1f8c479095ebf8420e6e11.zip
Qt-09264c709ea68e585c1f8c479095ebf8420e6e11.tar.gz
Qt-09264c709ea68e585c1f8c479095ebf8420e6e11.tar.bz2
QNX: Use inotify on QNX systems that support it
This is a backport of qtbase commit fc0cbef59599174589a606838a9b55ba6a07ef06 Change-Id: I27ca7222ed0e622bdae405f0802ab29e22f4cbbf Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/io.pri5
-rw-r--r--src/corelib/io/qfilesystemwatcher.cpp4
-rw-r--r--src/corelib/io/qfilesystemwatcher_inotify.cpp8
3 files changed, 17 insertions, 0 deletions
diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri
index 78993a0..e67e160 100644
--- a/src/corelib/io/io.pri
+++ b/src/corelib/io/io.pri
@@ -92,6 +92,11 @@ win32 {
SOURCES += io/qsettings_mac.cpp io/qfilesystemwatcher_fsevents.cpp
}
+ qnx:contains(QT_CONFIG, inotify) {
+ SOURCES += io/qfilesystemwatcher_inotify.cpp
+ HEADERS += io/qfilesystemwatcher_inotify_p.h
+ }
+
linux-*:!symbian {
SOURCES += \
io/qfilesystemwatcher_inotify.cpp \
diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp
index 71ccf7a..6f273a1 100644
--- a/src/corelib/io/qfilesystemwatcher.cpp
+++ b/src/corelib/io/qfilesystemwatcher.cpp
@@ -57,6 +57,8 @@
#elif defined(Q_OS_LINUX)
# include "qfilesystemwatcher_inotify_p.h"
# include "qfilesystemwatcher_dnotify_p.h"
+#elif defined(Q_OS_QNX) && !defined(QT_NO_INOTIFY)
+# include "qfilesystemwatcher_inotify_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"
@@ -248,6 +250,8 @@ QFileSystemWatcherEngine *QFileSystemWatcherPrivate::createNativeEngine()
{
#if defined(Q_OS_WIN)
return new QWindowsFileSystemWatcherEngine;
+#elif defined(Q_OS_QNX) && !defined(QT_NO_INOTIFY)
+ return QInotifyFileSystemWatcherEngine::create();
#elif defined(Q_OS_LINUX)
QFileSystemWatcherEngine *eng = QInotifyFileSystemWatcherEngine::create();
if(!eng)
diff --git a/src/corelib/io/qfilesystemwatcher_inotify.cpp b/src/corelib/io/qfilesystemwatcher_inotify.cpp
index bb4eef3..06f66489 100644
--- a/src/corelib/io/qfilesystemwatcher_inotify.cpp
+++ b/src/corelib/io/qfilesystemwatcher_inotify.cpp
@@ -52,12 +52,20 @@
#include <qsocketnotifier.h>
#include <qvarlengtharray.h>
+#if defined(Q_OS_LINUX)
#include <sys/syscall.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <fcntl.h>
+#endif
#if defined(QT_NO_INOTIFY)
+
+#if defined(Q_OS_QNX)
+// These files should only be compiled on QNX if the inotify headers are found
+#error "Should not get here."
+#endif
+
#include <linux/types.h>
#if defined(__i386__)