mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
a9bd0690fe
commit
02d572226d
6 changed files with 45 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue