mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
profile: register event names on creation of events
The event names were registered in add_event(). However, the undo system did not use that function, but add_event_to_dc(), which takes an already allocated event. That gave the following unfortunate situation: Load a log without setpoint changes. Add a setpoint change. The setpoint change event type now was not registered and therefore couldn't be hidden. Admittedly, a subtle bug, but still a bug. Fix by registering event names on event creation. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
0d3c9954f4
commit
4128fec1ea
2 changed files with 3 additions and 2 deletions
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include "divecomputer.h"
|
||||
#include "event.h"
|
||||
#include "eventname.h"
|
||||
#include "extradata.h"
|
||||
#include "pref.h"
|
||||
#include "sample.h"
|
||||
|
@ -443,7 +442,6 @@ struct event *add_event(struct divecomputer *dc, unsigned int time, int type, in
|
|||
|
||||
add_event_to_dc(dc, ev);
|
||||
|
||||
remember_event_name(name);
|
||||
return ev;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include "event.h"
|
||||
#include "eventname.h"
|
||||
#include "subsurface-string.h"
|
||||
|
||||
#include <string.h>
|
||||
|
@ -79,6 +80,8 @@ struct event *create_event(unsigned int time, int type, int flags, int value, co
|
|||
break;
|
||||
}
|
||||
|
||||
remember_event_name(name);
|
||||
|
||||
return ev;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue