mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
core: remove the "no-name" tank info
There was a tank info with an empty name. According to a comment, this is needed for the "no cylinder" case. However, we now support empty cylinder tables, so this is not needed anymore. Therefore, remove it. Make sure that the user can still enter the empty name, just in case. But don't save the size and pressure in that case. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
a55c7ff079
commit
11e576ffbf
2 changed files with 3 additions and 4 deletions
|
@ -251,9 +251,6 @@ void reset_tank_info_table(struct tank_info_table *table)
|
|||
{
|
||||
clear_tank_info_table(table);
|
||||
|
||||
/* Need an empty entry for the no-cylinder case */
|
||||
add_tank_info_metric(table, "", 0, 0);
|
||||
|
||||
/* Size-only metric cylinders */
|
||||
add_tank_info_metric(table, "10.0ℓ", 10000, 0);
|
||||
add_tank_info_metric(table, "11.1ℓ", 11100, 0);
|
||||
|
|
|
@ -218,8 +218,10 @@ void TankInfoDelegate::setModelData(QWidget *, QAbstractItemModel *, const QMode
|
|||
QAbstractItemModel *mymodel = currCombo.model;
|
||||
TankInfoModel *tanks = TankInfoModel::instance();
|
||||
QString cylinderName = currCombo.activeText.trimmed();
|
||||
if (cylinderName.isEmpty())
|
||||
if (cylinderName.isEmpty()) {
|
||||
mymodel->setData(IDX(CylindersModel::TYPE), cylinderName, CylindersModel::TEMP_ROLE);
|
||||
return;
|
||||
}
|
||||
QModelIndexList matches = tanks->match(tanks->index(0, 0), Qt::DisplayRole, cylinderName, 1, Qt::MatchFixedString | Qt::MatchWrap);
|
||||
int row;
|
||||
if (matches.isEmpty()) {
|
||||
|
|
Loading…
Reference in a new issue