]> cloud.milkyroute.net Git - dolphin.git/commit
Fix issue where newly inserted items end up in the wrong directory
authorDavid Edmundson <kde@davidedmundson.co.uk>
Fri, 7 Jan 2022 17:05:30 +0000 (17:05 +0000)
committerFelix Ernst <fe.a.ernst@gmail.com>
Fri, 4 Mar 2022 10:57:16 +0000 (10:57 +0000)
commitb6e03e05f4b63dc86c763f73ec863137ea59d2f0
treeef6368a0aa952002b150df2e5292ece282874ec3
parentcd369a151932e7076c24b01f94c5d6c5fe15ecef
Fix issue where newly inserted items end up in the wrong directory

If we have directory "a" and "a/b" and expand both, then collapse "a" we
tell KDirWatcher to stop watching both these directories.

However, KDirWatcher keeps them in the listersCurrentlyHolding list as
well as the listersCurrentlyListing list and will still notify of
changes. If a new file appears in "a/b/" we will still get change
notifications.

When dolphin processes these changes we cannot find the relevant parent
node. It then gets confused and inserts the item into the root directory
from the POV of the model notifications. When we then open the relevant
folder the model knows a node with that URL exists and fails to add it
correctly.

This can also be reproduced by continually downloading files into a
subdirectory tree and rapidly expanding and collapsing folders a few
levels deep.
src/kitemviews/kfileitemmodel.cpp
src/tests/kfileitemmodeltest.cpp