<table><tr><td style="">poboiko updated this revision to Diff 51062.<br />poboiko edited the summary of this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-czmls7z4jc55trb/">(Show Details)</a><br />poboiko added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D18698">View Revision</a></tr></table><br /><div><div><p>Added recursive iteration over all contents for <tt style="background: #ebebeb; font-size: 13px;">Create</tt> event as well</p></div></div><br /><div><strong>CHANGES TO REVISION SUMMARY</strong><div><div style="white-space: pre-wrap; color: #74777D;"><div style="padding: 8px 0;">...</div>for the moved directory, but not its contents.<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);"><br />
Also, it</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);"> <br />
It also</span> won't install watches for the directory (as it does in `EventCreate`).<br />
<br />
Instead use FilteredDirIterator to emit created() signal for all the contents as well, and add inotify watch<span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">es.</span><br />
<br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">Few side notes:<br />
 # It's not really realted to symbolic links, we just need to move a folder from excluded place to included.<br />
 # If we move folder from another device, `Inotify` doesn't create `Move` signal, but `Create` instead, which seems to be handled properly <br />
I'm not really sure why, because it smells like a race condition here.</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">It should also now handle the race condition if a directory was created</span> <br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">Assume user moves `folder/` with `folder/file1` and `folder/file2` files inside it. If the things happen in a following order:<br />
 # We receive `Create` signal for inotify<br />
 # `folder/file1` is moved<br />
 # We add inotify watch for `folder/`<br />
 # `folder/file2` is moved<br />
then we will receive `Create` signal only for `file2`</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">and files were moved inside it before an inotify watch for this directory was installed.<br />
<br />
Note that it's not really realted to symbolic links</span>, <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">losing information concerning `file1` completely</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">one just has to move a folder from excluded place to included</span>.<div style="padding: 8px 0;">...</div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R293 Baloo</div></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D18698?vs=50967&id=51062">https://phabricator.kde.org/D18698?vs=50967&id=51062</a></div></div><br /><div><strong>BRANCH</strong><div><div>add-watch-moved (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D18698">https://phabricator.kde.org/D18698</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>autotests/unit/file/kinotifytest.cpp<br />
src/file/kinotify.cpp<br />
src/file/kinotify.h</div></div></div><br /><div><strong>To: </strong>poboiko, Baloo, Frameworks, ngraham, bruns<br /><strong>Cc: </strong>bruns, ngraham, kde-frameworks-devel, Baloo, ashaposhnikov, michaelh, astippich, spoorun, abrahams<br /></div>