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

Igor Poboiko noreply at phabricator.kde.org
Sun Feb 3 15:44:20 GMT 2019


poboiko created this revision.
poboiko added reviewers: Baloo, Frameworks.
Herald added projects: Frameworks, Baloo.
poboiko requested review of this revision.

REVISION SUMMARY
  If a folder was moved from an unwatched place, `KInotify` will receive an `EventMoveTo` event,
  which doesn't have an `EventMoveFrom` counterpart, and thus it will emit only `created` signal
  for the moved directory, but not its contents.
  Also, it won't install watches for the directory (as it does in `EventCreate`).
  
  Instead use FilteredDirIterator to emit created() signal for all the contents as well, and add inotify watch
  
  Few side notes:
  
  1. It's not really realted to symbolic links, we just need to move a folder from excluded place to included.
  2. If we move folder from another device, `Inotify` doesn't create `Move` signal, but `Create` instead, which seems to be handled properly
  
  (I'm not really sure why, because it smells like a race condition here. 
  If i.e. we got `Create` signal -> then `file1` gets moved -> then we add watches -> then `file2` gets moved, information about file1 should get lost.
  Am I missing something here?)
  
  BUG: 342224

TEST PLAN
  Added a test case for `KInotifyTest`, similar to one described in Bug 342224. 
  It passes now.

REPOSITORY
  R293 Baloo

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
Cc: kde-frameworks-devel, #baloo, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190203/7de03cda/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list