summaryrefslogtreecommitdiffstats
path: root/profile-widget/profilewidget2.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-03-03 22:34:50 +0100
committerGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-04-07 00:13:35 +0200
commit30c7499a3c656784cc45825b4b1b2fca61081308 (patch)
tree32f8ad2c085e3a1706ed0994c0f39eadde39830d /profile-widget/profilewidget2.cpp
parent3aa1bb5bfae9a7ebf8f5e6cdbf751afcafdb4baf (diff)
downloadsubsurface-30c7499a3c656784cc45825b4b1b2fca61081308.tar.gz
undo: implement addBookmark undo command
Create a new translation unit for event-related undo commands. Create a base class of commands that add events and one subclass that adds a bookmark event. Use this command in the profile-widget. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/profilewidget2.cpp')
-rw-r--r--profile-widget/profilewidget2.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index 566c97732..67962b3bb 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -1600,10 +1600,7 @@ void ProfileWidget2::removeEvent(DiveEventItem *item)
void ProfileWidget2::addBookmark(int seconds)
{
- add_event(current_dc, seconds, SAMPLE_EVENT_BOOKMARK, 0, 0, "bookmark");
- invalidate_dive_cache(current_dive);
- mark_divelist_changed(true);
- replot();
+ Command::addEventBookmark(current_dive, dc_number, seconds);
}
void ProfileWidget2::addDivemodeSwitch(int seconds, int divemode)