Fix possible crash in KDirModel if the root item is deleted or moved
author Frank Reininghaus
()
committer Frank Reininghaus
()
commit 8d885c97b483b21ee13b6bf9539a1cb7e529102a
tree 7746a2bd9fa7a29e2e32ae583c56d23226b8c41d
parent aa705f2a16d437aad24df8846476bcc5e44c73bd
Fix possible crash in KDirModel if the root item is deleted or moved

If the root item of the dir model is deleted, but it is not the first
item in the list that KDirModelPrivate::_k_slotDeleteItems(...) gets
from the dir lister, a crash may result because
KDirModelPrivate::removeFromNodeHash(...) calls isDir() for a null
KFileItem. This commit extends the protection agains this kind of crash
that has been introduced in c8939409eed00420fb43ff22cfc6c9092e4da7e5 for
the first item to the rest of the list.
BUG: 196695
FIXED-IN: 4.6.4
(cherry picked from commit 83538b4339a65c90764975f01a4b9bafbabd9595)
kio/kio/kdirmodel.cpp
kio/tests/kdirmodeltest.cpp
kio/tests/kdirmodeltest.h