diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-02-07 21:23:00 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | 02d572226df82ccbdfff3c455c9e5b20a7992bc4 (patch) | |
tree | 26b213e2a2af1302631dd2dd2fd2ed3e622793ed /desktop-widgets/command_edit.cpp | |
parent | a9bd0690fe1d6bd841b0ede2ac53b280ef907b93 (diff) | |
download | subsurface-02d572226df82ccbdfff3c455c9e5b20a7992bc4.tar.gz |
Undo: implement undo of divemaster editing
This is mostly a trivial copy of the buddies code.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/command_edit.cpp')
-rw-r--r-- | desktop-widgets/command_edit.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/desktop-widgets/command_edit.cpp b/desktop-widgets/command_edit.cpp index 165bbbe90..8366db153 100644 --- a/desktop-widgets/command_edit.cpp +++ b/desktop-widgets/command_edit.cpp @@ -483,4 +483,27 @@ DiveField EditBuddies::fieldId() const return DiveField::BUDDY; } +// ***** DiveMaster ***** +QStringList EditDiveMaster::data(struct dive *d) const +{ + return stringToList(d->divemaster); +} + +void EditDiveMaster::set(struct dive *d, const QStringList &v) const +{ + QString text = v.join(", "); + free(d->divemaster); + d->divemaster = copy_qstring(text); +} + +QString EditDiveMaster::fieldName() const +{ + return tr("dive master"); +} + +DiveField EditDiveMaster::fieldId() const +{ + return DiveField::DIVEMASTER; +} + } // namespace Command |