┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2014-05-13 19:06:42 +0200
committerFrank Reininghaus <[email protected]>2014-05-13 19:06:42 +0200
commit99e8f8e2e6b6982d1a58185d0980be203d6061ec (patch)
tree96a100082048b64614b9f48076569a398d8bf21f
parent66f1759b6f993c237b9652b9aa51ac9df52e5238 (diff)
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
-rw-r--r--src/kitemviews/kfileitemmodel.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp
index 34a97de4c..de3c3eb22 100644
--- a/src/kitemviews/kfileitemmodel.cpp
+++ b/src/kitemviews/kfileitemmodel.cpp
@@ -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;