D18698: [baloo/KInotify] Notify if folder was moved from unwatched place

Igor Poboiko noreply at phabricator.kde.org
Mon Feb 4 11:43:14 GMT 2019


poboiko updated this revision to Diff 50832.
poboiko edited the summary of this revision.
poboiko added a comment.


  Explained the race condition in summary, expanded test to check if watches were installed correctly.
  
  I've encountered some pretty weird issue: the watch for the moved folder is not installed; but it is installed for all its subfolders.
  The reason is that `it.fileInfo()` returns empty `QFileInfo()` for the moved folder. But it works fine for all the subentries.
  That is not the issue with the previous version, because `KInotify::addWatch` doesn't check for `fileInfo().isDir()` explicitly: it just relies on `DirsOnly` flag for the iterator.
  
  There is a workaround: if I create `QFileInfo` by hand, using `QFileInfo fi(it.filePath())` instead of `it.fileInfo()`, everything seems to be working fine.
  (the test fails if I use `it.fileInfo()`, but it passes if I use this workaround)

REPOSITORY
  R293 Baloo

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D18698?vs=50776&id=50832

BRANCH
  add-watch-moved (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D18698

AFFECTED FILES
  autotests/unit/file/kinotifytest.cpp
  src/file/kinotify.cpp

To: poboiko, #baloo, #frameworks, ngraham, bruns
Cc: bruns, ngraham, kde-frameworks-devel, #baloo, ashaposhnikov, michaelh, astippich, spoorun, abrahams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190204/ac12afe9/attachment.html>


More information about the Kde-frameworks-devel mailing list