mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Removing gas change events @0:00 when new one is added
Remove the existing gas change events @0:00 when new one is added @0:00. Signed-off-by: Yousef Hamza <jo.adam.93@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e70dbb568d
commit
22eb8e0617
1 changed files with 23 additions and 0 deletions
|
@ -1391,6 +1391,29 @@ void ProfileWidget2::changeGas()
|
|||
struct gasmix gasmix;
|
||||
int seconds = timeAxis->valueAt(scenePos);
|
||||
|
||||
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);
|
||||
if (gasChangeEvent->time.seconds == 0) {
|
||||
remove_event(gasChangeEvent);
|
||||
eventRemoved = true;
|
||||
}
|
||||
gasChangeEvent = temp;
|
||||
}
|
||||
|
||||
if (eventRemoved) {
|
||||
mark_divelist_changed(true);
|
||||
replot();
|
||||
}
|
||||
}
|
||||
|
||||
validate_gas(gas.toUtf8().constData(), &gasmix);
|
||||
QRegExp rx("\\(\\D*(\\d+)");
|
||||
int tank;
|
||||
|
|
Loading…
Reference in a new issue