summaryrefslogtreecommitdiffstats
path: root/common/modelresult.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/modelresult.cpp')
-rw-r--r--common/modelresult.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/common/modelresult.cpp b/common/modelresult.cpp
index 0825518..f935419 100644
--- a/common/modelresult.cpp
+++ b/common/modelresult.cpp
@@ -228,12 +228,14 @@ void ModelResult<T, Ptr>::remove(const Ptr &value)
228 auto parent = createIndexFromId(id); 228 auto parent = createIndexFromId(id);
229 SinkTraceCtx(mLogCtx) << "Removed entity" << childId; 229 SinkTraceCtx(mLogCtx) << "Removed entity" << childId;
230 auto index = mTree[id].indexOf(childId); 230 auto index = mTree[id].indexOf(childId);
231 beginRemoveRows(parent, index, index); 231 if (index >= 0) {
232 mEntities.remove(childId); 232 beginRemoveRows(parent, index, index);
233 mTree[id].removeAll(childId); 233 mEntities.remove(childId);
234 mParents.remove(childId); 234 mTree[id].removeAll(childId);
235 // TODO remove children 235 mParents.remove(childId);
236 endRemoveRows(); 236 // TODO remove children
237 endRemoveRows();
238 }
237} 239}
238 240
239template <class T, class Ptr> 241template <class T, class Ptr>