Session: Update SessionNode when Project tree changes

This moves ownership of the project's root node from the
project into the project tree!

Change-Id: I84eba884bd63b44e56c75023d8bf12caf5cc2833
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Tobias Hunger
2017-03-03 14:40:02 +01:00
parent 707990632c
commit 71a5aee36f
6 changed files with 36 additions and 13 deletions

View File

@@ -420,13 +420,12 @@ void Project::setDocument(Core::IDocument *doc)
void Project::setRootProjectNode(ProjectNode *root)
{
ProjectNode *oldNode = d->m_rootProjectNode;
if (oldNode == root)
if (d->m_rootProjectNode == root)
return;
d->m_rootProjectNode = root;
emit projectTreeChanged(this, QPrivateSignal());
delete oldNode;
// Do not delete oldNode! The ProjectTree owns that!
}
Target *Project::restoreTarget(const QVariantMap &data)