From 2de389548c776d7d21047efd028b8fa35fc9082d Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 12 Feb 2015 18:10:45 +0100 Subject: [PATCH] Fix compilation issue with merge Change-Id: I5c1e2b6f0a7bb86e8076ec60342bf47d123eb123 Reviewed-by: Daniel Teske --- src/plugins/projectexplorer/kitmodel.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/plugins/projectexplorer/kitmodel.cpp b/src/plugins/projectexplorer/kitmodel.cpp index d785ca6e369..5f50ddcb864 100644 --- a/src/plugins/projectexplorer/kitmodel.cpp +++ b/src/plugins/projectexplorer/kitmodel.cpp @@ -174,23 +174,27 @@ void KitModel::isAutoDetectedChanged() { KitManagerConfigWidget *w = qobject_cast(sender()); int idx = -1; - idx = Utils::indexOf(m_manualRoot->childNodes, [w](KitNode *node) { return node->widget == w; }); - KitNode *oldParent = 0; - KitNode *newParent = w->workingCopy()->isAutoDetected() ? m_autoRoot : m_manualRoot; + idx = Utils::indexOf(m_manualRoot->children(), [w](TreeItem *node) { + return static_cast(node)->widget == w; + }); + TreeItem *oldParent = 0; + TreeItem *newParent = w->workingCopy()->isAutoDetected() ? m_autoRoot : m_manualRoot; if (idx != -1) { oldParent = m_manualRoot; } else { - idx = Utils::indexOf(m_autoRoot->childNodes, [w](KitNode *node) { return node->widget == w; }); + idx = Utils::indexOf(m_autoRoot->children(), [w](TreeItem *node) { + return static_cast(node)->widget == w; + }); if (idx != -1) { oldParent = m_autoRoot; } } if (oldParent && oldParent != newParent) { - beginMoveRows(index(oldParent), idx, idx, index(newParent), newParent->childNodes.size()); - KitNode *n = oldParent->childNodes.takeAt(idx); - n->parent = newParent; - newParent->childNodes.append(n); + beginMoveRows(indexFromItem(oldParent), idx, idx, indexFromItem(newParent), newParent->children().size()); + TreeItem *n = oldParent->children().at(idx); + removeItem(n); + newParent->appendChild(n); endMoveRows(); } }