diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-07-17 14:53:56 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-07-31 08:34:24 +0000 |
commit | d020016e9ece106c0214d050aa3a5802357aeb55 (patch) | |
tree | 450d0b0e859e1a2ba3640eac1c801b26161043bc /src/lib/corelib/buildgraph/artifact.cpp | |
parent | f8ba1f5c8d029840d24f342e92b116e5d107a835 (diff) |
Make sure the set of root artifacts is always up to date
... by updating it whenever artifact file tags change.
Change-Id: I62496ba73f7633888de6be16aca59777a53629ed
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/lib/corelib/buildgraph/artifact.cpp')
-rw-r--r-- | src/lib/corelib/buildgraph/artifact.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/corelib/buildgraph/artifact.cpp b/src/lib/corelib/buildgraph/artifact.cpp index ecfe362f0..f46e24d78 100644 --- a/src/lib/corelib/buildgraph/artifact.cpp +++ b/src/lib/corelib/buildgraph/artifact.cpp @@ -78,15 +78,21 @@ QString Artifact::toString() const void Artifact::addFileTag(const FileTag &t) { m_fileTags += t; - if (!product.expired() && product->buildData) + if (!product.expired() && product->buildData) { product->buildData->addFileTagToArtifact(this, t); + if (product->fileTags.contains(t)) + product->buildData->addRootNode(this); + } } void Artifact::removeFileTag(const FileTag &t) { m_fileTags -= t; - if (!product.expired() && product->buildData) + if (!product.expired() && product->buildData) { product->buildData->removeArtifactFromSetByFileTag(this, t); + if (product->fileTags.contains(t) && !product->fileTags.intersects(m_fileTags)) + product->buildData->removeFromRootNodes(this); + } } void Artifact::setFileTags(const FileTags &newFileTags) |