summaryrefslogtreecommitdiffstats
path: root/qt-models/weightmodel.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-04-11 11:03:05 -0700
committerGravatar GitHub <noreply@github.com>2020-04-11 11:03:05 -0700
commit6d187b5f4a3b51043fa3b53b6c73a7e0ec7f0b53 (patch)
tree93b26b7381e565ecc0dc6d93e2d35b61a1cdaca9 /qt-models/weightmodel.cpp
parent2990010ccde56acec980e76ef5671137e87af488 (diff)
parent7dc04b4437c7aa1788f7d85a513a246ce502dea4 (diff)
downloadsubsurface-6d187b5f4a3b51043fa3b53b6c73a7e0ec7f0b53.tar.gz
Merge pull request #2643 from bstoeger/cylinder4
First steps of cylinder-editing undo
Diffstat (limited to 'qt-models/weightmodel.cpp')
-rw-r--r--qt-models/weightmodel.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/qt-models/weightmodel.cpp b/qt-models/weightmodel.cpp
index 6e56071e2..6b5f9e70d 100644
--- a/qt-models/weightmodel.cpp
+++ b/qt-models/weightmodel.cpp
@@ -112,8 +112,10 @@ void WeightModel::commitTempWS()
return;
// Only submit a command if the type changed
weightsystem_t ws = d->weightsystems.weightsystems[tempRow];
- if (!same_string(ws.description, tempWS.description) || gettextFromC::tr(ws.description) != QString(tempWS.description))
- Command::editWeight(tempRow, tempWS, false);
+ if (!same_string(ws.description, tempWS.description) || gettextFromC::tr(ws.description) != QString(tempWS.description)) {
+ int count = Command::editWeight(tempRow, tempWS, false);
+ emit divesEdited(count);
+ }
tempRow = -1;
#endif
}
@@ -126,7 +128,8 @@ bool WeightModel::setData(const QModelIndex &index, const QVariant &value, int r
switch (index.column()) {
case WEIGHT:
ws.weight = string_to_weight(qPrintable(vString));
- Command::editWeight(index.row(), ws, false);
+ int count = Command::editWeight(index.row(), ws, false);
+ emit divesEdited(count);
return true;
}
return false;