summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2016-10-21 06:18:04 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2016-10-21 06:18:04 (GMT)
commit1a14f27fd626451c3ac0c24b0ec594c0e2dbe7db (patch)
treed0f12d6fe384865d3cf4a9aa86b8c3f909f45a8e
parent0b2997addf31e4c68580445271c460c61c658342 (diff)
fix segfault in ProxyItem::remChild by double-removing the same item
-rw-r--r--addons/filetree/katefiletreemodel.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/filetree/katefiletreemodel.cpp b/addons/filetree/katefiletreemodel.cpp
index 8fbdab0..db1df32 100644
--- a/addons/filetree/katefiletreemodel.cpp
+++ b/addons/filetree/katefiletreemodel.cpp
@@ -1164,7 +1164,8 @@ void KateFileTreeModel::handleDuplicitRootDisplay(ProxyItemDir *init)
const QString xy = rdir + QLatin1Char('/');
if (node->path().startsWith(xy)) {
beginRemoveRows(QModelIndex(), node->row(), node->row());
- check_root_removed = node == check_root;
+ // check_root_removed must be sticky
+ check_root_removed = check_root_removed || (node == check_root);
m_root->remChild(node);
endRemoveRows();
insertItemInto(irdir, node);