aacid added a comment.
In https://phabricator.kde.org/D7671#142933, @progwolff wrote: > In https://phabricator.kde.org/D7671#142826, @aacid wrote: > > > I don't know who told you this is the correct behaviour of kdirwatch, but i kind of disagree. > > > > Since we're not watching the file but *also* the folder. > > > From the KDirWatch class reference: > > > void KDirWatch::dirty ( const QString & path ) signal > > Emitted when a watched object is changed. > > > > For a directory this signal is emitted when files therein are created or deleted. [...] > > > > When you watch a directory, changes in the size or attributes of contained files may or may not trigger this signal to be emitted depending on which backend is used by KDirWatch. > > So, let's assume we have a file `path/file` loaded in Okular and we watch the directory `path` for changes. We remove `file` and create a new file named `file`. The directory `path` will get dirty, as a new file is created. > This means, a signal `dirty("path")` is emitted. However, Okular does not reload the document when the signal `dirty("path")` is received, but waits for a signal `dirty("path/file")`. No, the code doesn't wait *only* for a dirty for path/file, read Part::slotFileDirty better The problem here is that dirty for the path is not being emitted, https://mail.kde.org/pipermail/kde-frameworks-devel/2017-August/048813.html if the dirty for the dir was getting emitted on delete and on addition i'm positive this would work. > The behaviour of KDirWatch might not be the most convenient, but from my perspective it is consistent with the documentation. > Maybe the docs could be a little clearer at this point, like Henrik and Oliver proposed. > > ____________ > > In https://phabricator.kde.org/D7671#142844, @rkflx wrote: > >> (Julian: Sorry to intrude, feel free to pick up from here.) > > > Always happy when someone contributes good ideas to a discussion. REPOSITORY R223 Okular REVISION DETAIL https://phabricator.kde.org/D7671 To: progwolff, aacid Cc: sander, rkflx, #okular, aacid