forked from qt-creator/qt-creator
Debugger: Optimize insert watch item.
Change-Id: If15afbbc7bcf33367755cfd61d47670a28038e6f Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -1241,15 +1241,15 @@ void WatchHandler::insertItem(WatchItem *item)
|
||||
|
||||
void WatchModel::insertItem(WatchItem *item)
|
||||
{
|
||||
WatchItem *existing = findItem(item->iname);
|
||||
if (existing)
|
||||
WatchItem *parent = findItem(parentName(item->iname));
|
||||
QTC_ASSERT(parent, return);
|
||||
|
||||
if (WatchItem *existing = parent->findItem(item->iname))
|
||||
removeItem(existing);
|
||||
|
||||
//item->walkTree([item](TreeItem *sub) { sub->sortChildren(&watchItemSorter); });
|
||||
item->sortChildren(&watchItemSorter);
|
||||
|
||||
WatchItem *parent = findItem(parentName(item->iname));
|
||||
QTC_ASSERT(parent, return);
|
||||
const int row = findInsertPosition(parent->children(), item);
|
||||
parent->insertChild(row, item);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user