mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Simplify the code that replaces a gas change event at t=0
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ddff93f096
commit
74638c5f65
1 changed files with 5 additions and 10 deletions
|
@ -1393,21 +1393,16 @@ void ProfileWidget2::changeGas()
|
|||
|
||||
if (seconds == 0) {
|
||||
bool eventRemoved = false;
|
||||
QString tempStr = "gaschange";
|
||||
char *gaschangeStr = tempStr.toUtf8().data();
|
||||
|
||||
struct event *gasChangeEvent = get_next_event(current_dc->events, gaschangeStr);
|
||||
struct event *temp;
|
||||
|
||||
while (gasChangeEvent) {
|
||||
temp = get_next_event(current_dc->events, gaschangeStr);
|
||||
struct event *gasChangeEvent = current_dc->events;
|
||||
while ((gasChangeEvent = get_next_event(gasChangeEvent, "gaschange")) != NULL) {
|
||||
if (gasChangeEvent->time.seconds == 0) {
|
||||
remove_event(gasChangeEvent);
|
||||
eventRemoved = true;
|
||||
gasChangeEvent = current_dc->events;
|
||||
} else {
|
||||
gasChangeEvent = gasChangeEvent->next;
|
||||
}
|
||||
gasChangeEvent = temp;
|
||||
}
|
||||
|
||||
if (eventRemoved) {
|
||||
mark_divelist_changed(true);
|
||||
replot();
|
||||
|
|
Loading…
Add table
Reference in a new issue