KCoreDirLister: fix crash when creating new folders from kfilewidget
When creating multiple nested new folders, one at a time, in the "save as"
dialog, where folders are created and entered, a dirlister would hit an
assert (in DirItem::reinsert()), because one of the created folders would
eventually get inserted in pendingUpdates.
Add a unit test in kfilewidgettest.
- Open a file in e.g. okular, then "save as"
- Create a new folder from the dialog, then another ... etc, usually 2-3 new folders would hit the assert (keep going, the number varies apparently) and the app would crash
- Apply the patch then try again, it shouldn't crash
Reviewers: Frameworks, ahmadsamir
Subscribers: dhaumann, kde-frameworks-devel
Differential Revision: https://phabricator.kde.org/D23875