<table><tr><td style="">chinmoyr created this revision.<br />chinmoyr added a reviewer: dfaure.<br />Herald added a project: Frameworks.<br />Herald added a subscriber: kde-frameworks-devel.<br />chinmoyr 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/D21197">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Here I am trying to fix #405461. We reach this assertion in reinsert() after we create a new folder<br />
in kfilewidget. The code path is triggered by the signal KDirWatch::created which is then followed<br />
by itemsAddedInDirectory(), updateDirectory(), processPendingUpdates() and then reinsert().</p>
<p>Now there are two issues with reinsert(). First it asserts that DirItem::lstItems (list of KItems)<br />
must contain a KItem whose url is lexicographically greater than the oldUrl we are trying to update.<br />
But when creating folders from kfilewidget it is almost always not true. In fact after creating a<br />
new folder it is empty.</p>
<p>Other issue is with the behaviour of reinsert(). In case the exact KItem for oldUrl doesn't exist,<br />
it replaces the first greater KItem with the new one. From this method's description and from what I<br />
have observed so far this behaviours is incorrect. So removing the assertion seems to be an appropriate <br />
way to fix the bug.</p>
<p>PS: Following the code has been difficult so I might have missed a place where<br />
placing an extra updateDirectory() call would have fixed the issue or I might be talking nonsense here.<br />
Please correct me if this is the case.</p>
<p>BUG: 405461</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R241 KIO</div></div></div><br /><div><strong>BRANCH</strong><div><div>kcoredirlister</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D21197">https://phabricator.kde.org/D21197</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/core/kcoredirlister_p.h</div></div></div><br /><div><strong>To: </strong>chinmoyr, dfaure<br /><strong>Cc: </strong>kde-frameworks-devel, michaelh, ngraham, bruns<br /></div>