D7671: Fix automatic reload of files saved with QSaveFile

Julian Wolff noreply at phabricator.kde.org
Mon Sep 4 10:32:21 UTC 2017


progwolff added a comment.


  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")`.
  
  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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20170904/03d34d31/attachment.html>


More information about the Okular-devel mailing list