Okular reloads pdf files automatically when they change on disk. I would expect the markdown backend to do the same. a) for consistency and b) because it is convenient when writing markdown.
this is a bug not a wish, i'm kind of surprised this doens't work, nothing pdf sepcific in the reload path
Can you reproduce it?
Yes works for me. HAvne't you destroyed this feature locally while testing patches D7595/D7495 ?
No, I merely looked at these patches, but never tested them. More experimentation has revealed the following: Automatic reload does work as expected when I 'touch' the file, or when I save it from 'vi'. It does not work when I save it from Kate. How can that be?
I can confirm this too, for both markdown and txt documents (and probably others). In part.cpp:1729, slotFileDirty, we check if the path of a document that got dirty matches with the file path of the currently loaded document. When editing a document with Kate, the .kate-swp file gets dirty, but not the actual document. For me this seems like a bug in either Kate or KDirWatch, not in Okular.
We had code for this, i guess someone broke it when porting to KF5.
After reading the code i agree it seems a regression in kdirwatch
Meh, it's probably a regression in inotify since i build the old kdelibs4 version and that doesn't work anymore either. I'll try to add some more code and ideally an autotest.
Git commit e3747ca3fd9b9926ff8c52879da7fca1a620fef5 by Julian Wolff. Committed on 07/09/2017 at 11:18. Pushed by jwolff into branch 'master'. Fix automatic reload of files saved with QSaveFile Summary: Files saved with QSaveFile don't get dirty. They are deleted and replaced. Thus, inotify and KDirWatch don't emit a "dirty" signal (which is the correct behaviour). Listening for the "created" signal of KDirWatch allows us to get notified on replaced files. Test Plan: Opened a markdown document in Okular. Edited and saved the document with Kate. The file is reloaded in Okular as expected. Reviewers: aacid Reviewed By: aacid Subscribers: sander, rkflx, #okular Tags: #okular Differential Revision: https://phabricator.kde.org/D7671 M +1 -0 part.cpp https://commits.kde.org/okular/e3747ca3fd9b9926ff8c52879da7fca1a620fef5
Git commit bedc3dbeadd450a860770308ffc2ca5538cf42b9 by Albert Astals Cid, on behalf of Julian Wolff. Committed on 07/09/2017 at 19:49. Pushed by aacid into branch 'Applications/17.08'. Fix automatic reload of files saved with QSaveFile Summary: Files saved with QSaveFile don't get dirty. They are deleted and replaced. Thus, inotify and KDirWatch don't emit a "dirty" signal (which is the correct behaviour). Listening for the "created" signal of KDirWatch allows us to get notified on replaced files. Test Plan: Opened a markdown document in Okular. Edited and saved the document with Kate. The file is reloaded in Okular as expected. Reviewers: aacid Reviewed By: aacid Subscribers: sander, rkflx, #okular Tags: #okular Differential Revision: https://phabricator.kde.org/D7671 M +1 -0 part.cpp https://commits.kde.org/okular/bedc3dbeadd450a860770308ffc2ca5538cf42b9