mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
planner: split DivePlannerPointsModel::remove() in two
There are two cases in this function: with and without holding the control-key. The former deletes one point, the latter all points starting with the selected point to the end. The code was interlaced making it very hard to reason about. Notably, it was buggy: with control, all points could be deleted, leading to a crash. Split the function in two versions, with their own bound checking. This produces a bit of duplicate code, which might be broken out later. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
a0f6b4d0b4
commit
11c54b85f6
2 changed files with 41 additions and 22 deletions
|
|
@ -86,6 +86,7 @@ slots:
|
|||
void savePlan();
|
||||
void saveDuplicatePlan();
|
||||
void remove(const QModelIndex &index);
|
||||
void removeControlPressed(const QModelIndex &index);
|
||||
void cancelPlan();
|
||||
void removeDeco();
|
||||
void deleteTemporaryPlan();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue