Commit 9084d1ed authored by David Thompson's avatar David Thompson Committed by Kitware Robot

Merge topic 'dirty-resource-asterisks'

bfcb8680 Mark each dirty resource with an asterisk...
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: T.J. Corona's avatarT.J. Corona <tj.corona@kitware.com>
Merge-request: !1315
parents f20ed63d bfcb8680
Pipeline #122603 canceled with stage
in 0 seconds
......@@ -382,12 +382,22 @@ QVariant qtDescriptivePhraseModel::data(const QModelIndex& idx, int role) const
else if (role == PhraseCleanRole)
{
int clean = -1;
auto modelComp = dynamic_pointer_cast<smtk::model::Entity>(item->relatedComponent());
if (modelComp)
auto rsrc = item->relatedResource();
auto comp = item->relatedComponent();
if (rsrc && !comp)
{
auto ent = modelComp->referenceAs<smtk::model::EntityRef>();
clean = static_cast<int>(
ent.hasIntegerProperty("clean") ? ent.integerProperty("clean")[0] : -1);
clean = rsrc->clean() ? 1 : 0; // Clean == 1, dirty == 0, N/A == -1
}
else
{
// TODO: Remove this eventually; we should only show file-level clean/dirty.
auto modelComp = dynamic_pointer_cast<smtk::model::Entity>(comp);
if (modelComp)
{
auto ent = modelComp->referenceAs<smtk::model::EntityRef>();
clean = static_cast<int>(
ent.hasIntegerProperty("clean") ? ent.integerProperty("clean")[0] : -1);
}
}
return QVariant(clean);
}
......
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