If a sub-directory is created in a listed directory and then watched by KDirWatch, KDirLister does not emit its itemsDeleted(KFileItemList) signal if this sub-directory is removed.
I'll attach a unit test in a minute.
This is noticeable in Dolphin in Details View mode: if a directory is removed using a terminal, it does not disappear from the view. The reason is that Dolphin watches all directories in the view for changes because arrows are shown next to a directory if it is not empty, and these arrows must be updated every time the "directory is empty" state changes.
Reproducible steps that trigger this issue were found in the forum:
Created attachment 77687 [details]
Git commit 1f6d6cfc44a909a972b974fe4b79c0ef521ddd14 by David Faure.
Committed on 14/03/2013 at 14:20.
Pushed by dfaure into branch 'KDE/4.10'.
Fix KDirWatch to emit dirty on parent dir when watched subdir is deleted
In Inotify mode, there's a special event for the case where a watched
dir is deleted ("IN_DELETESELF"). In the handling of that event, we must
still set the parent directory to dirty, in case another KDirWatch
only cares for the parent.
Excellent unit test by Frank Reininghaus, as usual -- thanks!
M +8 -0 kdecore/io/kdirwatch.cpp
M +42 -0 kio/tests/kdirlistertest.cpp
M +1 -0 kio/tests/kdirlistertest.h