Undo: implement undo of dive site description editing

Simply duplicate the code of dive site name editing. Split out
the common functionality that swaps a C and a Qt string.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-03-13 20:10:22 +01:00 committed by Dirk Hohndel
parent 0fd85832b7
commit 2dcc0a7d1e
6 changed files with 58 additions and 4 deletions

View file

@ -234,6 +234,9 @@ bool DiveSiteSortedModel::setData(const QModelIndex &index, const QVariant &valu
case LocationInformationModel::NAME:
Command::editDiveSiteName(ds, value.toString());
return true;
case LocationInformationModel::DESCRIPTION:
Command::editDiveSiteDescription(ds, value.toString());
return true;
default:
return false;
}