mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fixes garbage left behind when canceling edit dive.
Garbage was left behind when canceling edit dive, and thus when the user set his dive to be editted, after a first canceled edition, all points of the first edition got messed up and showing on the second dive too. if the user clicked 'ok', he got a really bad surprise. Fixes #226 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
parent
d3fe3494fe
commit
f850a0817c
1 changed files with 7 additions and 0 deletions
|
@ -431,6 +431,13 @@ void DivePlannerPointsModel::loadFromDive(dive* d)
|
|||
* as soon as the model is modified, it will
|
||||
* remove all samples from the current dive.
|
||||
* */
|
||||
|
||||
/* On the safe side, clear everything before
|
||||
editing the new dive. */
|
||||
beginRemoveRows(QModelIndex(), 0, rowCount()-1);
|
||||
divepoints.clear();
|
||||
endRemoveRows();
|
||||
|
||||
backupSamples.clear();
|
||||
for(int i = 1; i < d->dc.samples-1; i++){
|
||||
backupSamples.push_back( d->dc.sample[i]);
|
||||
|
|
Loading…
Add table
Reference in a new issue