[PATCH 2/2] Ticket #831 Fix

Dirk Hohndel dirk at hohndel.org
Tue Mar 10 07:51:44 PDT 2015


On Tue, Mar 10, 2015 at 01:59:53AM +0200, Yosef Hamza wrote:
> On Tue, Mar 10, 2015 at 1:18 AM, Dirk Hohndel <dirk at hohndel.org> wrote:
> >
> >
> >
> > @@ -1392,6 +1395,23 @@ void ProfileWidget2::changeGas()
> >                 qDebug() << "failed to parse tank number";
> >                 tank = get_gasidx(&displayed_dive, &gasmix);
> >         }
> > +
> > +       struct event **events = &get_dive_dc(&displayed_dive,
> > dc_number)->events;
> > +       while (*events) {
> > +               if ((*events)->time.seconds == 0) {
> > +                       remove_event(*events);
> >
> > You cannot use remove_event() on events from displayed_dive. It only
> > removes events from current_dive
> 
> So I should figure out a way to remove it from the displayed_dive or don't
> do anything about it?

You simply ask the UI code to refresh the display and it will copied over
the displayed dive. Look at the other spot where remove_event() is called.

/D


More information about the subsurface mailing list