<table><tr><td style="">poboiko created this revision.<br />poboiko added reviewers: Baloo, Frameworks.<br />Herald added projects: Frameworks, Baloo.<br />poboiko requested review of this revision.
</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><strong>REVISION SUMMARY</strong><div><p>If a folder was moved from an unwatched place, <tt style="background: #ebebeb; font-size: 13px;">KInotify</tt> will receive an <tt style="background: #ebebeb; font-size: 13px;">EventMoveTo</tt> event,<br />
which doesn't have an <tt style="background: #ebebeb; font-size: 13px;">EventMoveFrom</tt> counterpart, and thus it will emit only <tt style="background: #ebebeb; font-size: 13px;">created</tt> signal<br />
for the moved directory, but not its contents.<br />
Also, it won't install watches for the directory (as it does in <tt style="background: #ebebeb; font-size: 13px;">EventCreate</tt>).</p>
<p>Instead use FilteredDirIterator to emit created() signal for all the contents as well, and add inotify watch</p>
<p>Few side notes:</p>
<ol class="remarkup-list">
<li class="remarkup-list-item">It's not really realted to symbolic links, we just need to move a folder from excluded place to included.</li>
<li class="remarkup-list-item">If we move folder from another device, <tt style="background: #ebebeb; font-size: 13px;">Inotify</tt> doesn't create <tt style="background: #ebebeb; font-size: 13px;">Move</tt> signal, but <tt style="background: #ebebeb; font-size: 13px;">Create</tt> instead, which seems to be handled properly</li>
</ol>
<p>(I'm not really sure why, because it smells like a race condition here. <br />
If i.e. we got <tt style="background: #ebebeb; font-size: 13px;">Create</tt> signal -> then <tt style="background: #ebebeb; font-size: 13px;">file1</tt> gets moved -> then we add watches -> then <tt style="background: #ebebeb; font-size: 13px;">file2</tt> gets moved, information about file1 should get lost.<br />
Am I missing something here?)</p>
<p>BUG: 342224</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Added a test case for <tt style="background: #ebebeb; font-size: 13px;">KInotifyTest</tt>, similar to one described in Bug 342224. <br />
It passes now.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R293 Baloo</div></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</div></div></div><br /><div><strong>To: </strong>poboiko, Baloo, Frameworks<br /><strong>Cc: </strong>kde-frameworks-devel, Baloo, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams<br /></div>