Skip to content

Draft: Allow KDirWatch to support multiple file Entry on a single inotify watch descriptor

Michael Pyne requested to merge work/mpyne/kdirwatch-multi-inotify into master

I decided to do some good in the world and look at Bugzilla, ended up choosing bug 387663 to look at, which pertains to Dolphin not showing new files due to a potential KDirWatch bug with inotify.

While I wasn't able to quickly reproduce, a comment on the bug seemed to reproduce with watches against directories with a symlink, hypothesizing the most recent watch would overwrite a previous watch because inotify would assign them both the same watch descriptor.

This made sense to me so I tried to address that by watching multiple Entry objects for a single watch descriptor. But KDirWatch is some hairy code and I'm not sure if I'm seeing the problem right, or approaching it right.

Note, I moved a large chunk of inotify handling code to a separate method as I was looking to simplify my understanding of what was going on. That move is in its own commit which should make no other changes. It is probably easier to look directly at commit 484eac31 for the actual code change.

Merge request reports