mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: use C++ structures for weightsystem info
Use std::vector<> instead of fixed size array. Doesn't do any logic change, even though the back-translation logic is ominous. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
c5f96d877d
commit
1af00703b3
8 changed files with 58 additions and 72 deletions
|
@ -339,10 +339,9 @@ void WSInfoDelegate::setModelData(QWidget *, QAbstractItemModel *, const QModelI
|
|||
{
|
||||
WeightModel *mymodel = qobject_cast<WeightModel *>(currCombo.model);
|
||||
QString weightName = currCombo.activeText;
|
||||
ws_info_t *info = get_weightsystem_description(qPrintable(weightName));
|
||||
int grams = info ? info->grams : 0;
|
||||
weight_t weight = get_weightsystem_weight(qPrintable(weightName));
|
||||
|
||||
mymodel->setTempWS(currCombo.currRow, weightsystem_t{ { grams }, copy_qstring(weightName), false });
|
||||
mymodel->setTempWS(currCombo.currRow, weightsystem_t{ weight, copy_qstring(weightName), false });
|
||||
}
|
||||
|
||||
static QAbstractItemModel *createWSInfoModel(QWidget *parent)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue