diff options
author | hjk <hjk@theqtcompany.com> | 2016-07-04 15:53:53 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2016-07-06 11:41:55 +0000 |
commit | 7b4c7d49a9a5c74cbbdbd0a46467d3eff4eab2f2 (patch) | |
tree | a8666105b76e30b49c097e1ca29e38a70e25a8df /src/plugins/debugger/moduleshandler.cpp | |
parent | 4c5ee0c02b5d87aa596913f8c0a7f0e27bf8ff8d (diff) | |
download | qt-creator-7b4c7d49a9a5c74cbbdbd0a46467d3eff4eab2f2.tar.gz |
TreeModel: Introduce a destroyItem() convenience function
Shorthand for delete takeItem(...).
Change-Id: Icb7b60e5c19aa0d21650eefff65f7eb55e9f90b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/debugger/moduleshandler.cpp')
-rw-r--r-- | src/plugins/debugger/moduleshandler.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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<ModuleItem *>(root->child(i)); if (!item->updated) - delete m_model->takeItem(item); + m_model->destroyItem(item); } } |