Cleanup: introduce empty_weightsystem constant

To make things more future-proof, introduce an empty_weightsystem
constant. Replace explicit aggragate initialization of empty
weightsystems by this constant.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-11-03 23:08:32 +01:00 committed by Dirk Hohndel
parent 92b833a7d8
commit dc67876c79
4 changed files with 6 additions and 6 deletions

View file

@ -23,7 +23,7 @@ weightsystem_t WeightModel::weightSystemAt(const QModelIndex &index) const
int row = index.row();
if (row < 0 || row >= d->weightsystems.nr) {
qWarning("WeightModel: Accessing invalid weightsystem %d (of %d)", row, d->weightsystems.nr);
return { { 0 }, nullptr };
return empty_weightsystem;
}
return d->weightsystems.weightsystems[index.row()];
}