diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2014-01-13 17:08:09 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@digia.com> | 2014-01-14 16:53:49 +0100 |
commit | b457b5efdd2ea80b4d1a8167467a93a2e8a05019 (patch) | |
tree | c269f36ed2f49966b68e5901e7ac06a19d405ae0 | |
parent | ba6f8ec38d1429eb28e9b2c507d1df7339229e8c (diff) |
Fix build data rescuing.
The old implementation allowed more than one connection
to a child with the same file path represented by
different artifact objects.
Change-Id: I38db86c50f0f671fdcb05d481f51fb512442cbfd
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
-rw-r--r-- | src/lib/buildgraph/buildgraphloader.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/buildgraph/buildgraphloader.cpp b/src/lib/buildgraph/buildgraphloader.cpp index a75e83b02..46013f512 100644 --- a/src/lib/buildgraph/buildgraphloader.cpp +++ b/src/lib/buildgraph/buildgraphloader.cpp @@ -778,12 +778,12 @@ void BuildGraphLoader::rescueOldBuildData(const ResolvedProductConstPtr &restore artifact->setTimestamp(oldArtifact->timestamp()); foreach (Artifact * const oldChild, childLists.value(oldArtifact)) { - foreach (FileResourceBase *childFileRes, - newlyResolvedProduct->topLevelProject()->buildData->lookupFiles(oldChild)) { - Artifact * const child = dynamic_cast<Artifact *>(childFileRes); - if (child && !artifact->children.contains(child)) - safeConnect(artifact, child, m_logger); - } + Artifact * const newChild = lookupArtifact(oldChild->product, + newlyResolvedProduct->topLevelProject()->buildData.data(), + oldChild->filePath(), true); + if (!newChild || artifact->children.contains(newChild)) + continue; + safeConnect(artifact, newChild, m_logger); } } } |