[FstabWatcher] Fix loosing of fstab watcher
Summary:
In case the fstab is deleted (caused by editing it), the watch will be
removed. The code already partially dealed with this, i.e. it tried to
readd the watch, but did not check if the operation succeeded and dropped
any further changes if not.
Keep a watch on the containing folder and readd the fstab on change
events. Unfortunately QFilesystemWatcher does not allow fine granular
change events, though as /etc/ is likely mostly silent this should not
matter much.
The bug becomes apparent when e.g. editing the fstab with VIM, which
has a quite broken implementation of creating temporary/backup files
during save: it moves away the original file and creates the new file
directly under the original name, instead of using a atomic rename.
Test Plan:
- solid-hardware listen
- open fstab with vi, save a few times
Without the change, solid will loose the watch sooner or later.
Depends on D28779
Reviewers: Frameworks, ngraham, apol
Reviewed By: ngraham, apol
Subscribers: apol, kde-frameworks-devel
Tags: Frameworks
Differential Revision: https://phabricator.kde.org/D28780