From 504be82ba6a59f74104a76fed8d03474bf933fcf Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 28 Mar 2016 07:09:50 +0200 Subject: [PATCH] KSPM: Only clear firstChild mappings for top-level Otherwise we would accidentally clear row 0 in top-level in the proxy when some nested row 0 is removed in the source. --- src/kselectionproxymodel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kselectionproxymodel.cpp b/src/kselectionproxymodel.cpp index a8a65fc..7f66f8a 100644 --- a/src/kselectionproxymodel.cpp +++ b/src/kselectionproxymodel.cpp @@ -1263,7 +1263,9 @@ void KSelectionProxyModelPrivate::endRemoveRows(const QModelIndex &sourceParent, // If D and F are selected, the proxy contains E, F, G, H. If B is then deleted E to H will // be removed, including both first child mappings at E and G. - removeFirstChildMappings(proxyStart, proxyEnd); + if (!proxyParent.isValid()) { + removeFirstChildMappings(proxyStart, proxyEnd); + } } if (proxyParent.isValid()) {