forked from qt-creator/qt-creator
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user