Commit f488c10c authored by Christian Kandeler's avatar Christian Kandeler
Browse files

QbsProjectManager: Fix project node operations.



The qbsProjectData() member function always returned the top-level
project data, which messed up a couple of things, for instance
"build sub-projects" and the node tree updates.
Instead, return the project data corresponding to the node.

Change-Id: If40c441c62334f0069a5fe3cb4873cf973baf135
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@digia.com>
parent 49e6e153
......@@ -752,6 +752,7 @@ void QbsProjectNode::update(const qbs::ProjectData &prjData)
removeProjectNodes(toRemove);
addProjectNodes(toAdd);
m_projectData = prjData;
}
QbsProject *QbsProjectNode::project() const
......@@ -764,11 +765,6 @@ const qbs::Project QbsProjectNode::qbsProject() const
return project()->qbsProject();
}
const qbs::ProjectData QbsProjectNode::qbsProjectData() const
{
return project()->qbsProjectData();
}
bool QbsProjectNode::showInSimpleTree() const
{
return true;
......
......@@ -168,7 +168,7 @@ public:
virtual QbsProject *project() const;
const qbs::Project qbsProject() const;
const qbs::ProjectData qbsProjectData() const;
const qbs::ProjectData qbsProjectData() const { return m_projectData; }
bool showInSimpleTree() const;
......@@ -182,6 +182,7 @@ private:
QbsProjectNode *findProjectNode(const QString &name);
static QIcon m_projectIcon;
qbs::ProjectData m_projectData;
};
// --------------------------------------------------------------------
......
......@@ -243,6 +243,7 @@ bool QbsProject::addFilesToProduct(QbsBaseProjectNode *node, const QStringList &
if (notAdded->count() != filePaths.count()) {
m_projectData = m_qbsProject.projectData();
QbsGroupNode::setupFiles(node, allPaths, QFileInfo(productFilePath).absolutePath(), true);
m_rootProjectNode->update();
}
return notAdded->isEmpty();
}
......@@ -268,6 +269,7 @@ bool QbsProject::removeFilesFromProduct(QbsBaseProjectNode *node, const QStringL
if (notRemoved->count() != filePaths.count()) {
m_projectData = m_qbsProject.projectData();
QbsGroupNode::setupFiles(node, allPaths, QFileInfo(productFilePath).absolutePath(), true);
m_rootProjectNode->update();
}
return notRemoved->isEmpty();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment