Utils: Add a AspectContainer::isDirty convenience function

Change-Id: I8503c715742bce8f59da9b0e6c7e7a85c5fc397b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
hjk
2021-03-16 06:01:09 +01:00
parent 54e195642c
commit 687d6a76ec
2 changed files with 10 additions and 0 deletions

View File

@@ -2081,6 +2081,15 @@ void AspectContainer::setAutoApply(bool on)
aspect->setAutoApply(on); aspect->setAutoApply(on);
} }
bool AspectContainer::isDirty() const
{
for (BaseAspect *aspect : qAsConst(d->m_items)) {
if (aspect->isDirty())
return true;
}
return false;
}
bool AspectContainer::equals(const AspectContainer &other) const bool AspectContainer::equals(const AspectContainer &other) const
{ {
// FIXME: Expensive, but should not really be needed in a fully aspectified world. // FIXME: Expensive, but should not really be needed in a fully aspectified world.

View File

@@ -529,6 +529,7 @@ public:
bool equals(const AspectContainer &other) const; bool equals(const AspectContainer &other) const;
void copyFrom(const AspectContainer &other); void copyFrom(const AspectContainer &other);
void setAutoApply(bool on); void setAutoApply(bool on);
bool isDirty() const;
void forEachAspect(const std::function<void(BaseAspect *)> &run) const; void forEachAspect(const std::function<void(BaseAspect *)> &run) const;