summaryrefslogtreecommitdiffstats
path: root/qt-models/weightmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models/weightmodel.cpp')
-rw-r--r--qt-models/weightmodel.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/qt-models/weightmodel.cpp b/qt-models/weightmodel.cpp
index 020e14c24..7e89f30bf 100644
--- a/qt-models/weightmodel.cpp
+++ b/qt-models/weightmodel.cpp
@@ -94,8 +94,10 @@ void WeightModel::setTempWS(int row, weightsystem_t ws)
tempWS = ws;
// If the user had already set a weight, don't overwrite that
- if (oldWS.weight.grams)
+ if (oldWS.weight.grams && !oldWS.auto_filled)
tempWS.weight = oldWS.weight;
+ else
+ tempWS.auto_filled = true;
}
dataChanged(index(row, TYPE), index(row, WEIGHT));
}
@@ -133,6 +135,7 @@ bool WeightModel::setData(const QModelIndex &index, const QVariant &value, int r
switch (index.column()) {
case WEIGHT:
ws.weight = string_to_weight(qPrintable(vString));
+ ws.auto_filled = false;
int count = Command::editWeight(index.row(), ws, false);
emit divesEdited(count);
return true;