Commit 82a341da authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Qbs: Rename a couple of members to make them more obviously Qbs related



This is to avoid confusion between methods referring to Qt Creator classes
and Qbs classes of the same name.

Change-Id: I25b40c6fe1d2272a9d9b0f7fab2a4cafa079df8c
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 728a06aa
......@@ -267,20 +267,20 @@ QList<ProjectExplorer::RunConfiguration *> QbsBaseProjectNode::runConfigurations
QbsGroupNode::QbsGroupNode(const qbs::GroupData *grp, const QString &productPath) :
QbsBaseProjectNode(QString()),
m_group(0)
m_qbsGroupData(0)
{
setIcon(m_groupIcon);
setGroup(grp, productPath);
setQbsGroupData(grp, productPath);
}
bool QbsGroupNode::isEnabled() const
{
return static_cast<QbsProductNode *>(parentFolderNode())->isEnabled() && group()->isEnabled();
return static_cast<QbsProductNode *>(parentFolderNode())->isEnabled() && qbsGroupData()->isEnabled();
}
void QbsGroupNode::setGroup(const qbs::GroupData *group, const QString &productPath)
void QbsGroupNode::setQbsGroupData(const qbs::GroupData *group, const QString &productPath)
{
if (group == m_group && productPath == m_productPath)
if (group == m_qbsGroupData && productPath == m_productPath)
return;
m_productPath = productPath;
......@@ -291,7 +291,7 @@ void QbsGroupNode::setGroup(const qbs::GroupData *group, const QString &productP
// set up file node...
QbsFileNode *indexFile = 0;
if (!m_group) {
if (!m_qbsGroupData) {
indexFile = new QbsFileNode(group->location().fileName,
ProjectExplorer::ProjectFileType, false,
group->location().line);
......@@ -303,14 +303,14 @@ void QbsGroupNode::setGroup(const qbs::GroupData *group, const QString &productP
indexFile->emitNodeUpdated();
}
m_group = group;
m_qbsGroupData = group;
setGroup(this, group, productPath, QList<ProjectExplorer::Node *>() << indexFile);
setQbsGroupData(this, group, productPath, QList<ProjectExplorer::Node *>() << indexFile);
emitNodeUpdated();
}
void QbsGroupNode::setGroup(QbsBaseProjectNode *root, const qbs::GroupData *group,
const QString &productPath, QList<ProjectExplorer::Node *> keepers)
void QbsGroupNode::setQbsGroupData(QbsBaseProjectNode *root, const qbs::GroupData *group,
const QString &productPath, QList<ProjectExplorer::Node *> keepers)
{
// Build up a tree of nodes:
FileTreeNode *tree = new FileTreeNode(QString());
......@@ -395,20 +395,20 @@ void QbsGroupNode::setupFolders(QbsBaseProjectNode *topLevel, ProjectExplorer::F
QbsProductNode::QbsProductNode(const qbs::ProductData *prd) :
QbsBaseProjectNode(prd->location().fileName),
m_product(0)
m_qbsProductData(0)
{
setIcon(m_productIcon);
setProduct(prd);
setQbsProductData(prd);
}
bool QbsProductNode::isEnabled() const
{
return product()->isEnabled();
return qbsProductData()->isEnabled();
}
void QbsProductNode::setProduct(const qbs::ProductData *prd)
void QbsProductNode::setQbsProductData(const qbs::ProductData *prd)
{
if (m_product == prd)
if (m_qbsProductData == prd)
return;
setDisplayName(prd->name());
......@@ -437,14 +437,14 @@ void QbsProductNode::setProduct(const qbs::ProductData *prd)
foreach (const qbs::GroupData &grp, prd->groups()) {
if (grp.name() == prd->name() && grp.location() == prd->location()) {
// Set implicit product group right onto this node:
QbsGroupNode::setGroup(this, &grp, productPath, toKeep);
QbsGroupNode::setQbsGroupData(this, &grp, productPath, toKeep);
continue;
}
QbsGroupNode *qn = findGroupNode(grp.name());
if (qn) {
toRemove.removeAll(qn);
toKeep.append(qn);
qn->setGroup(&grp, productPath);
qn->setQbsGroupData(&grp, productPath);
} else {
qn = new QbsGroupNode(&grp, productPath);
toAdd.append(qn);
......@@ -455,7 +455,7 @@ void QbsProductNode::setProduct(const qbs::ProductData *prd)
addProjectNodes(toAdd);
removeProjectNodes(toRemove);
m_product = prd;
m_qbsProductData = prd;
emitNodeUpdated();
}
......@@ -463,7 +463,7 @@ QbsGroupNode *QbsProductNode::findGroupNode(const QString &name)
{
foreach (ProjectExplorer::ProjectNode *n, subProjectNodes()) {
QbsGroupNode *qn = static_cast<QbsGroupNode *>(n);
if (qn->group()->name() == name)
if (qn->qbsGroupData()->name() == name)
return qn;
}
return 0;
......@@ -475,7 +475,7 @@ QbsGroupNode *QbsProductNode::findGroupNode(const QString &name)
QbsProjectNode::QbsProjectNode(const QString &projectFile) :
QbsBaseProjectNode(projectFile),
m_project(0), m_projectData(0)
m_qbsProject(0), m_qbsProjectData(0)
{
setIcon(m_projectIcon);
addFileNodes(QList<ProjectExplorer::FileNode *>()
......@@ -484,8 +484,8 @@ QbsProjectNode::QbsProjectNode(const QString &projectFile) :
QbsProjectNode::~QbsProjectNode()
{
delete m_projectData;
delete m_project;
delete m_qbsProjectData;
delete m_qbsProject;
}
void QbsProjectNode::update(const qbs::Project *prj)
......@@ -502,37 +502,37 @@ void QbsProjectNode::update(const qbs::Project *prj)
if (!qn) {
toAdd << new QbsProductNode(&prd);
} else {
qn->setProduct(&prd);
qn->setQbsProductData(&prd);
toRemove.removeOne(qn);
}
}
}
delete m_projectData;
m_projectData = newData;
delete m_qbsProjectData;
m_qbsProjectData = newData;
delete m_project;
m_project = prj;
delete m_qbsProject;
m_qbsProject = prj;
removeProjectNodes(toRemove);
addProjectNodes(toAdd);
}
const qbs::Project *QbsProjectNode::project() const
const qbs::Project *QbsProjectNode::qbsProject() const
{
return m_project;
return m_qbsProject;
}
const qbs::ProjectData *QbsProjectNode::projectData() const
const qbs::ProjectData *QbsProjectNode::qbsProjectData() const
{
return m_projectData;
return m_qbsProjectData;
}
QbsProductNode *QbsProjectNode::findProductNode(const QString &name)
{
foreach (ProjectExplorer::ProjectNode *n, subProjectNodes()) {
QbsProductNode *qn = static_cast<QbsProductNode *>(n);
if (qn->product()->name() == name)
if (qn->qbsProductData()->name() == name)
return qn;
}
return 0;
......
......@@ -115,12 +115,12 @@ public:
QbsGroupNode(const qbs::GroupData *grp, const QString &productPath);
bool isEnabled() const;
void setGroup(const qbs::GroupData *group, const QString &productPath);
const qbs::GroupData *group() const { return m_group; }
void setQbsGroupData(const qbs::GroupData *qbsGroupData, const QString &productPath);
const qbs::GroupData *qbsGroupData() const { return m_qbsGroupData; }
QString productPath() const;
static void setGroup(QbsBaseProjectNode *root, const qbs::GroupData *group,
static void setQbsGroupData(QbsBaseProjectNode *root, const qbs::GroupData *qbsGroupData,
const QString &productPath, QList<Node *> keepers);
private:
......@@ -128,7 +128,7 @@ private:
const QString &baseDirPath,
QList<ProjectExplorer::Node *> keepers = QList<ProjectExplorer::Node *>());
const qbs::GroupData *m_group;
const qbs::GroupData *m_qbsGroupData;
QString m_productPath;
static QIcon m_groupIcon;
......@@ -147,13 +147,13 @@ public:
bool isEnabled() const;
void setProduct(const qbs::ProductData *prd);
const qbs::ProductData *product() const { return m_product; }
void setQbsProductData(const qbs::ProductData *prd);
const qbs::ProductData *qbsProductData() const { return m_qbsProductData; }
private:
QbsGroupNode *findGroupNode(const QString &name);
const qbs::ProductData *m_product;
const qbs::ProductData *m_qbsProductData;
static QIcon m_productIcon;
};
......@@ -171,14 +171,14 @@ public:
void update(const qbs::Project *prj);
const qbs::Project *project() const;
const qbs::ProjectData *projectData() const;
const qbs::Project *qbsProject() const;
const qbs::ProjectData *qbsProjectData() const;
private:
QbsProductNode *findProductNode(const QString &name);
const qbs::Project *m_project;
const qbs::ProjectData *m_projectData;
const qbs::Project *m_qbsProject;
const qbs::ProjectData *m_qbsProjectData;
static QIcon m_projectIcon;
};
} // namespace Internal
......
......@@ -97,7 +97,9 @@ namespace Internal {
// --------------------------------------------------------------------
QbsProject::QbsProject(QbsManager *manager, const QString &fileName) :
m_manager(manager), m_projectName(QFileInfo(fileName).completeBaseName()), m_fileName(fileName),
m_manager(manager),
m_projectName(QFileInfo(fileName).completeBaseName()),
m_fileName(fileName),
m_rootProjectNode(new QbsProjectNode(fileName)),
m_qbsSetupProjectJob(0),
m_qbsUpdateFutureInterface(0),
......@@ -155,8 +157,8 @@ QStringList QbsProject::files(ProjectExplorer::Project::FilesMode fileMode) cons
{
Q_UNUSED(fileMode);
QSet<QString> result;
if (m_rootProjectNode && m_rootProjectNode->projectData()) {
foreach (const qbs::ProductData &prd, m_rootProjectNode->projectData()->products()) {
if (m_rootProjectNode && m_rootProjectNode->qbsProjectData()) {
foreach (const qbs::ProductData &prd, m_rootProjectNode->qbsProjectData()->products()) {
foreach (const qbs::GroupData &grp, prd.groups()) {
foreach (const QString &file, grp.allFilePaths())
result.insert(file);
......@@ -164,7 +166,7 @@ QStringList QbsProject::files(ProjectExplorer::Project::FilesMode fileMode) cons
}
result.insert(prd.location().fileName);
}
result.insert(m_rootProjectNode->projectData()->location().fileName);
result.insert(m_rootProjectNode->qbsProjectData()->location().fileName);
}
return result.toList();
}
......@@ -229,14 +231,14 @@ const qbs::Project *QbsProject::qbsProject() const
{
if (!m_rootProjectNode)
return 0;
return m_rootProjectNode->project();
return m_rootProjectNode->qbsProject();
}
const qbs::ProjectData *QbsProject::qbsProjectData() const
{
if (!m_rootProjectNode)
return 0;
return m_rootProjectNode->projectData();
return m_rootProjectNode->qbsProjectData();
}
bool QbsProject::needsSpecialDeployment() const
......@@ -265,10 +267,10 @@ void QbsProject::handleQbsParsingDone(bool success)
m_rootProjectNode->update(project);
updateDocuments(m_rootProjectNode->projectData());
updateDocuments(m_rootProjectNode->qbsProjectData());
updateCppCodeModel(m_rootProjectNode->projectData());
updateQmlJsCodeModel(m_rootProjectNode->projectData());
updateCppCodeModel(m_rootProjectNode->qbsProjectData());
updateQmlJsCodeModel(m_rootProjectNode->qbsProjectData());
foreach (ProjectExplorer::Target *t, targets())
t->updateDefaultRunConfigurations();
......
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