From 7b4c7d49a9a5c74cbbdbd0a46467d3eff4eab2f2 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 4 Jul 2016 15:53:53 +0200 Subject: TreeModel: Introduce a destroyItem() convenience function Shorthand for delete takeItem(...). Change-Id: Icb7b60e5c19aa0d21650eefff65f7eb55e9f90b0 Reviewed-by: Christian Stenger --- src/plugins/debugger/moduleshandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/plugins/debugger/moduleshandler.cpp') diff --git a/src/plugins/debugger/moduleshandler.cpp b/src/plugins/debugger/moduleshandler.cpp index e08a9045a4..5e0edcd008 100644 --- a/src/plugins/debugger/moduleshandler.cpp +++ b/src/plugins/debugger/moduleshandler.cpp @@ -207,7 +207,7 @@ Modules ModulesHandler::modules() const void ModulesHandler::removeModule(const QString &modulePath) { if (ModuleItem *item = moduleFromPath(m_model->rootItem(), modulePath)) - delete m_model->takeItem(item); + m_model->destroyItem(item); } void ModulesHandler::updateModule(const Module &module) @@ -249,7 +249,7 @@ void ModulesHandler::endUpdateAll() for (int i = root->rowCount(); --i >= 0; ) { auto item = static_cast(root->child(i)); if (!item->updated) - delete m_model->takeItem(item); + m_model->destroyItem(item); } } -- cgit v1.2.1