mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
0b190243dd
The DiveEventItem had an internal copy of the event. It passed that copy to the undo-machinery, which of course didn't work. Simply keep a pointer to the event. All changes to a dive no pass via the undo-machinery, which causes a reload of the profile, so this should be safe. Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#ifndef DIVEEVENTITEM_H
|
|
#define DIVEEVENTITEM_H
|
|
|
|
#include "divepixmapitem.h"
|
|
|
|
class DiveCartesianAxis;
|
|
class DivePlotDataModel;
|
|
struct event;
|
|
|
|
class DiveEventItem : public DivePixmapItem {
|
|
Q_OBJECT
|
|
public:
|
|
DiveEventItem(const struct dive *d, struct event *ev, struct gasmix lastgasmix,
|
|
DivePlotDataModel *model, DiveCartesianAxis *hAxis, DiveCartesianAxis *vAxis,
|
|
int speed, QGraphicsItem *parent = nullptr);
|
|
~DiveEventItem();
|
|
const struct event *getEvent() const;
|
|
struct event *getEventMutable();
|
|
void eventVisibilityChanged(const QString &eventName, bool visible);
|
|
void setVerticalAxis(DiveCartesianAxis *axis, int speed);
|
|
void setHorizontalAxis(DiveCartesianAxis *axis);
|
|
void setModel(DivePlotDataModel *model);
|
|
bool shouldBeHidden();
|
|
public
|
|
slots:
|
|
void recalculatePos(int animationSpeed);
|
|
|
|
private:
|
|
void setupToolTipString(struct gasmix lastgasmix);
|
|
void setupPixmap(struct gasmix lastgasmix);
|
|
int depthAtTime(int time);
|
|
DiveCartesianAxis *vAxis;
|
|
DiveCartesianAxis *hAxis;
|
|
DivePlotDataModel *dataModel;
|
|
struct event *ev;
|
|
const struct dive *dive;
|
|
};
|
|
|
|
#endif // DIVEEVENTITEM_H
|