Utils: Let aspect transition functions indicate there was a change

Helps to make it easier to reason about the necessity of emitting
*changed signals.

Change-Id: Ieab29b25f5cc2799e193417b9cab02c99501c60a
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
hjk
2023-07-20 14:25:13 +02:00
parent 11e1c7b1a4
commit 7cc6078756
6 changed files with 103 additions and 50 deletions

View File

@@ -151,7 +151,7 @@ void SuppressionAspect::addToLayout(Layouting::LayoutItem &parent)
void SuppressionAspect::fromMap(const QVariantMap &map)
{
BaseAspect::fromMap(map);
BaseAspect::fromMap(map); // FIXME Looks wrong, as it skips the intermediate level
}
void SuppressionAspect::toMap(QVariantMap &map) const
@@ -159,11 +159,13 @@ void SuppressionAspect::toMap(QVariantMap &map) const
BaseAspect::toMap(map);
}
void SuppressionAspect::guiToBuffer()
bool SuppressionAspect::guiToBuffer()
{
const FilePaths old = m_buffer;
m_buffer.clear();
for (int i = 0; i < d->m_model.rowCount(); ++i)
m_buffer.append(FilePath::fromUserInput(d->m_model.item(i)->text()));
return m_buffer != old;
}
void SuppressionAspect::bufferToGui()