forked from qt-creator/qt-creator
TreeModel: Rework tree iteration
Use function objects to apply directly during a depth-first walk of the tree instead of faking a flat container of tree nodes. Less code, and allows even some non-const operations. Change-Id: I804ab11df358fe937b40809cbcb772e6f3ff8dc5 Reviewed-by: David Schulz <david.schulz@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -1361,8 +1361,9 @@ void WatchHandler::notifyUpdateStarted(const QList<QByteArray> &inames)
|
||||
auto marker = [](TreeItem *it) { static_cast<WatchItem *>(it)->outdated = true; };
|
||||
|
||||
if (inames.isEmpty()) {
|
||||
foreach (auto item, m_model->itemsAtLevel<WatchItem *>(2))
|
||||
m_model->forEachItemAtLevel<WatchItem *>(2, [marker](WatchItem *item) {
|
||||
item->walkTree(marker);
|
||||
});
|
||||
} else {
|
||||
foreach (auto iname, inames) {
|
||||
if (WatchItem *item = m_model->findItem(iname))
|
||||
|
||||
Reference in New Issue
Block a user