diff options
author | hjk <hjk@theqtcompany.com> | 2015-01-14 09:09:15 +0100 |
---|---|---|
committer | hjk <hjk@theqtcompany.com> | 2015-01-15 16:06:38 +0100 |
commit | 7e522c8a3719b8f65f8f45ff46635011714fad09 (patch) | |
tree | af116f3b048a1e4fd49a0d5c8970a3616b90507b /src/plugins/debugger/moduleshandler.cpp | |
parent | 6bc0b9e5d36b228cd19656936f35845fddfce255 (diff) | |
download | qt-creator-7e522c8a3719b8f65f8f45ff46635011714fad09.tar.gz |
TreeModel: Add model pointer to TreeItem
... and use the items themselves as main entry point for
item related operations.
With non-uniform tree items it's easier to have item specific
functionality directly in the item implementation instead of
the model.
Change-Id: I4e9b7db98d16b91ddef81917417691129bb83621
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Diffstat (limited to 'src/plugins/debugger/moduleshandler.cpp')
-rw-r--r-- | src/plugins/debugger/moduleshandler.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/debugger/moduleshandler.cpp b/src/plugins/debugger/moduleshandler.cpp index f1df561f71..8efb7b63b5 100644 --- a/src/plugins/debugger/moduleshandler.cpp +++ b/src/plugins/debugger/moduleshandler.cpp @@ -198,7 +198,7 @@ QAbstractItemModel *ModulesHandler::model() const void ModulesHandler::removeAll() { - m_model->removeAllSubItems(m_model->rootItem()); + m_model->removeItems(); } Modules ModulesHandler::modules() const @@ -228,13 +228,13 @@ void ModulesHandler::updateModule(const Module &module) } else { item = new ModuleItem; item->module = module; - m_model->appendItem(m_model->rootItem(), item); + m_model->rootItem()->appendChild(item); } try { // MinGW occasionallly throws std::bad_alloc. ElfReader reader(path); item->module.elfData = reader.readHeaders(); - m_model->updateItem(item); + item->update(); } catch(...) { qWarning("%s: An exception occurred while reading module '%s'", Q_FUNC_INFO, qPrintable(module.modulePath)); |