forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -131,7 +131,7 @@ DebuggerItemModel::DebuggerItemModel()
|
||||
void DebuggerItemModel::addDebugger(const DebuggerItem &item, bool changed)
|
||||
{
|
||||
int group = item.isAutoDetected() ? 0 : 1;
|
||||
appendItem(rootItem()->child(group), new DebuggerTreeItem(item, changed));
|
||||
rootItem()->child(group)->appendChild(new DebuggerTreeItem(item, changed));
|
||||
}
|
||||
|
||||
void DebuggerItemModel::updateDebugger(const DebuggerItem &item)
|
||||
@@ -146,8 +146,7 @@ void DebuggerItemModel::updateDebugger(const DebuggerItem &item)
|
||||
const DebuggerItem *orig = DebuggerItemManager::findById(item.id());
|
||||
treeItem->m_changed = !orig || *orig != item;
|
||||
treeItem->m_item = item;
|
||||
|
||||
updateItem(treeItem); // Notify views.
|
||||
treeItem->update(); // Notify views.
|
||||
}
|
||||
|
||||
QModelIndex DebuggerItemModel::lastIndex() const
|
||||
|
||||
Reference in New Issue
Block a user