summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/equipment.c3
-rw-r--r--desktop-widgets/modeldelegates.cpp4
2 files changed, 3 insertions, 4 deletions
diff --git a/core/equipment.c b/core/equipment.c
index 0b40b30c0..253ef2086 100644
--- a/core/equipment.c
+++ b/core/equipment.c
@@ -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);
diff --git a/desktop-widgets/modeldelegates.cpp b/desktop-widgets/modeldelegates.cpp
index 11d42c36e..acfbfde52 100644
--- a/desktop-widgets/modeldelegates.cpp
+++ b/desktop-widgets/modeldelegates.cpp
@@ -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()) {