Revision d56f017...

Go back to digest for 8th June 2014

Bug Fixes in KDE Base

Matthew John Dawson committed changes in [kcoreaddons] /:

Fix KDirWatch to act more reliably against various backends.

- When KDirWatch used a FAM backend, it wouldn't actually wait for the
necessary watches to be put in place before returning, allowing for a race
where an application may think a watch is in place when it really isn't.
This was easily seen using gamin and running the testDeleteAndRecreateFile
test. Fix by delaying useFAM until the watch is in place by waiting until
the EndExist FAM event is received. This adds ~100-200ms per watch with
gamin.
- When a file is deleted and recreated, and scanEntry detects it, the dirty
signal would be emitted. Fix to emit a deleted + created signal, as expected.
- When a deleted signal was requested, other signals were dropped. Due to
the above point, this would stop the created signal from being emitted. Now,
all signals are emitted, even when a delete is detected.
- When watching recreated files, the created signal could get lost as there
was a race between when the created signal would be generated and its signal
spy would be created. Fix by making sure the spy is created before the signal
could be emitted.
- Make sure the created signal isn't emitted twice with both FAM and the
polling timer. This occurs as FAM doesn't fix up the fact the entry has been
created, and the poller thus assumes it needs to notify the world. Fix by
having FAM not emit the event in this case.


REVIEW: 118458

File Changes

Modified 3 files
  •   autotests/kdirwatch_unittest.cpp
  •   src/lib/io/kdirwatch.cpp
  •   src/lib/io/kdirwatch_p.h
3 files changed in total