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