KDirWatch vs QFileSystemWatcher
Sune Vuorela
nospam at vuorela.dk
Thu Oct 24 21:54:42 UTC 2013
Hi
If your KDirWatch backend is QFileSystemWatcher, one of the testcases
fails.
The last QVERIFY in testMoveTo never receives the signal dirty-signal it
is looking for.
Apparantly, the watch.removeFile apparantly somehow turns off the QFSW
to not do any further notifications for what happens in the directory
that it also is supposed to be watching.
I haven't yet fully understood what's going on here, but if someone is
up for it, fixing it would be nice. Among others, it is the only backend
available on windows.
This dirty patch seems to ensure that QFSW is used on your platform:
diff --git a/tier1/kcoreaddons/src/lib/io/kdirwatch.cpp b/tier1/kcoreaddons/src/lib/io/kdirwatch.cpp
index 2a89372..8bc9d9b 100644
--- a/tier1/kcoreaddons/src/lib/io/kdirwatch.cpp
+++ b/tier1/kcoreaddons/src/lib/io/kdirwatch.cpp
@@ -103,12 +103,7 @@ static KDirWatch::Method methodFromString(const QString &method) {
} else if (method == QLatin1String("QFSWatch")) {
return KDirWatch::QFSWatch;
} else {
-#ifdef Q_OS_LINUX
- // inotify supports delete+recreate+modify, which QFSWatch doesn't support
- return KDirWatch::INotify;
-#else
return KDirWatch::QFSWatch;
-#endif
}
}
Anyone looking into it would be nice.
/Sune
More information about the Kde-frameworks-devel
mailing list