- Watch directories exclusively as this is the only viable cross-platform compatible method unless the user set KDEV_PROJECT_INTREE_DIRWATCHING_MODE.
When watching directories, take into consideration that 1) a notification can come from a new or changed hidden file; 2) many changes can be signalled in rapid succession and 3) notifications are about changes in the given directory (= not in any of its subdirs).
Nothing can be done about 1) but the other 2 points are taken into account:
- queue reloads (with a rather arbitrary 1s cool-off delay) instead of starting them at once.
- reloads due to change notifications are marked disposable
- when another notification arrives for a directory that's already reloading (or scheduled for), abort the current job(s) where possible (or skip the directory if it's a subdir) before creating the new job. Consider only "disposable" jobs for this.
- when the notification is about an already known directory the reload will be non-recursive.
- file manager list jobs are registered with the RunController.