Commit aebc90ec authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Qbs: Simplify code a bit



Change-Id: Ie61f71f143ac1b46e092167abb9b58a1d16c36c6
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent fc36ce7d
...@@ -260,15 +260,6 @@ QString QbsFileNode::displayName() const ...@@ -260,15 +260,6 @@ QString QbsFileNode::displayName() const
return ProjectExplorer::FileNode::displayName() + QLatin1Char(':') + QString::number(l); return ProjectExplorer::FileNode::displayName() + QLatin1Char(':') + QString::number(l);
} }
bool QbsFileNode::update(const qbs::CodeLocation &loc)
{
const QString oldPath = path();
const int oldLine = line();
setPathAndLine(loc.fileName(), loc.line());
return (line() != oldLine || path() != oldPath);
}
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// QbsBaseProjectNode: // QbsBaseProjectNode:
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
...@@ -437,8 +428,8 @@ void QbsGroupNode::updateQbsGroupData(const qbs::GroupData *grp, const QString & ...@@ -437,8 +428,8 @@ void QbsGroupNode::updateQbsGroupData(const qbs::GroupData *grp, const QString &
if (idx) if (idx)
break; break;
} }
if (idx->update(grp->location()) || updateExisting) QTC_ASSERT(idx, return);
idx->emitNodeUpdated(); idx->setPathAndLine(grp->location().fileName(), grp->location().line());
setupFiles(this, grp->allFilePaths(), productPath, updateExisting); setupFiles(this, grp->allFilePaths(), productPath, updateExisting);
...@@ -639,8 +630,8 @@ void QbsProductNode::setQbsProductData(const qbs::ProductData prd) ...@@ -639,8 +630,8 @@ void QbsProductNode::setQbsProductData(const qbs::ProductData prd)
if (idx) if (idx)
break; break;
} }
if (idx->update(prd.location()) || updateExisting) QTC_ASSERT(idx, return);
idx->emitNodeUpdated(); idx->setPathAndLine(prd.location().fileName(), prd.location().line());
QList<ProjectExplorer::ProjectNode *> toAdd; QList<ProjectExplorer::ProjectNode *> toAdd;
QList<ProjectExplorer::ProjectNode *> toRemove = subProjectNodes(); QList<ProjectExplorer::ProjectNode *> toRemove = subProjectNodes();
......
...@@ -55,8 +55,6 @@ public: ...@@ -55,8 +55,6 @@ public:
int line); int line);
QString displayName() const; QString displayName() const;
bool update(const qbs::CodeLocation &loc);
}; };
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
......
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