summaryrefslogtreecommitdiffstats
path: root/commands/command_event.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'commands/command_event.cpp')
-rw-r--r--commands/command_event.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/commands/command_event.cpp b/commands/command_event.cpp
index 6d217da65..2b9176af5 100644
--- a/commands/command_event.cpp
+++ b/commands/command_event.cpp
@@ -2,6 +2,7 @@
#include "command_event.h"
#include "core/dive.h"
+#include "core/selection.h"
#include "core/subsurface-qt/divelistnotifier.h"
#include "core/libdivecomputer.h"
#include "core/gettextfromc.h"
@@ -17,15 +18,21 @@ EventBase::EventBase(struct dive *dIn, int dcNrIn) :
void EventBase::redo()
{
redoit(); // Call actual function in base class
- invalidate_dive_cache(d);
- emit diveListNotifier.eventsChanged(d);
+ updateDive();
}
void EventBase::undo()
{
undoit(); // Call actual function in base class
+ updateDive();
+}
+
+void EventBase::updateDive()
+{
invalidate_dive_cache(d);
emit diveListNotifier.eventsChanged(d);
+ dc_number = dcNr;
+ setSelection({ d }, d);
}
AddEventBase::AddEventBase(struct dive *d, int dcNr, struct event *ev) : EventBase(d, dcNr),