Fix compilation issue with merge

Change-Id: I5c1e2b6f0a7bb86e8076ec60342bf47d123eb123
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
Eike Ziller
2015-02-12 18:10:45 +01:00
parent 56aadc407d
commit 2de389548c

View File

@@ -174,23 +174,27 @@ void KitModel::isAutoDetectedChanged()
{ {
KitManagerConfigWidget *w = qobject_cast<KitManagerConfigWidget *>(sender()); KitManagerConfigWidget *w = qobject_cast<KitManagerConfigWidget *>(sender());
int idx = -1; int idx = -1;
idx = Utils::indexOf(m_manualRoot->childNodes, [w](KitNode *node) { return node->widget == w; }); idx = Utils::indexOf(m_manualRoot->children(), [w](TreeItem *node) {
KitNode *oldParent = 0; return static_cast<KitNode *>(node)->widget == w;
KitNode *newParent = w->workingCopy()->isAutoDetected() ? m_autoRoot : m_manualRoot; });
TreeItem *oldParent = 0;
TreeItem *newParent = w->workingCopy()->isAutoDetected() ? m_autoRoot : m_manualRoot;
if (idx != -1) { if (idx != -1) {
oldParent = m_manualRoot; oldParent = m_manualRoot;
} else { } 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<KitNode *>(node)->widget == w;
});
if (idx != -1) { if (idx != -1) {
oldParent = m_autoRoot; oldParent = m_autoRoot;
} }
} }
if (oldParent && oldParent != newParent) { if (oldParent && oldParent != newParent) {
beginMoveRows(index(oldParent), idx, idx, index(newParent), newParent->childNodes.size()); beginMoveRows(indexFromItem(oldParent), idx, idx, indexFromItem(newParent), newParent->children().size());
KitNode *n = oldParent->childNodes.takeAt(idx); TreeItem *n = oldParent->children().at(idx);
n->parent = newParent; removeItem(n);
newParent->childNodes.append(n); newParent->appendChild(n);
endMoveRows(); endMoveRows();
} }
} }