mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: pass event to event_type functions
Instead of passing name / flag pairs to event_type functions, pass a pointer to the event. This hides implementation details. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
d3c9cb14bf
commit
6ad7e577f1
6 changed files with 20 additions and 20 deletions
|
|
@ -224,11 +224,6 @@ bool DiveEventItem::isInteresting(const struct dive *d, const struct divecompute
|
|||
return true;
|
||||
}
|
||||
|
||||
bool DiveEventItem::shouldBeHidden()
|
||||
{
|
||||
return is_event_type_hidden(ev->name, ev->flags);
|
||||
}
|
||||
|
||||
void DiveEventItem::recalculatePos()
|
||||
{
|
||||
if (!ev)
|
||||
|
|
@ -238,7 +233,7 @@ void DiveEventItem::recalculatePos()
|
|||
hide();
|
||||
return;
|
||||
}
|
||||
setVisible(!shouldBeHidden());
|
||||
setVisible(!is_event_type_hidden(ev));
|
||||
double x = hAxis->posAtValue(ev->time.seconds);
|
||||
double y = vAxis->posAtValue(depth);
|
||||
setPos(x, y);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ public:
|
|||
void eventVisibilityChanged(const QString &eventName, bool visible);
|
||||
void setVerticalAxis(DiveCartesianAxis *axis, int speed);
|
||||
void setHorizontalAxis(DiveCartesianAxis *axis);
|
||||
bool shouldBeHidden();
|
||||
static bool isInteresting(const struct dive *d, const struct divecomputer *dc,
|
||||
const struct event *ev, const struct plot_info &pi,
|
||||
int firstSecond, int lastSecond);
|
||||
|
|
|
|||
|
|
@ -702,7 +702,7 @@ void ProfileWidget2::hideSimilarEvents(DiveEventItem *item)
|
|||
const struct event *event = item->getEvent();
|
||||
|
||||
if (!empty_string(event->name)) {
|
||||
hide_event_type(event->name, event->flags);
|
||||
hide_event_type(event);
|
||||
|
||||
replot();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue