D21197: [KCoreDirLister] Remove assert in reinsert method
Chinmoy Ranjan Pradhan
noreply at phabricator.kde.org
Mon May 13 19:47:20 BST 2019
chinmoyr created this revision.
chinmoyr added a reviewer: dfaure.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
chinmoyr requested review of this revision.
REVISION SUMMARY
Here I am trying to fix #405461. We reach this assertion in reinsert() after we create a new folder
in kfilewidget. The code path is triggered by the signal KDirWatch::created which is then followed
by itemsAddedInDirectory(), updateDirectory(), processPendingUpdates() and then reinsert().
Now there are two issues with reinsert(). First it asserts that DirItem::lstItems (list of KItems)
must contain a KItem whose url is lexicographically greater than the oldUrl we are trying to update.
But when creating folders from kfilewidget it is almost always not true. In fact after creating a
new folder it is empty.
Other issue is with the behaviour of reinsert(). In case the exact KItem for oldUrl doesn't exist,
it replaces the first greater KItem with the new one. From this method's description and from what I
have observed so far this behaviours is incorrect. So removing the assertion seems to be an appropriate
way to fix the bug.
PS: Following the code has been difficult so I might have missed a place where
placing an extra updateDirectory() call would have fixed the issue or I might be talking nonsense here.
Please correct me if this is the case.
BUG: 405461
REPOSITORY
R241 KIO
BRANCH
kcoredirlister
REVISION DETAIL
https://phabricator.kde.org/D21197
AFFECTED FILES
src/core/kcoredirlister_p.h
To: chinmoyr, dfaure
Cc: kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190513/856c2731/attachment.html>
More information about the Kde-frameworks-devel
mailing list