mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
Stop listing children of collapsed folders
Before this patch, KDirLister would continue listing any children of collapsed folders, even though the children themselves were removed from the model. This could lead to new items being inserted as top-level items at some later point, because no parent could be found for them. This inconsistent model state could lead to a crash later on. Many thanks to Martin Koller for helping to debug this problem! BUG: 332102 REVIEW: 118055 FIXED-IN: 4.13.2
This commit is contained in:
parent
e0aec6f923
commit
4642301ea0
1 changed files with 2 additions and 0 deletions
|
@ -512,7 +512,9 @@ bool KFileItemModel::setExpanded(int index, bool expanded)
|
|||
ItemData* itemData = m_itemData.at(childIndex);
|
||||
if (itemData->values.value("isExpanded").toBool()) {
|
||||
const KUrl targetUrl = itemData->item.targetUrl();
|
||||
const KUrl url = itemData->item.url();
|
||||
m_expandedDirs.remove(targetUrl);
|
||||
m_dirLister->stop(url); // TODO: try to unit-test this, see https://bugs.kde.org/show_bug.cgi?id=332102#c11
|
||||
expandedChildren.append(targetUrl);
|
||||
}
|
||||
++childIndex;
|
||||
|
|
Loading…
Reference in a new issue