mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix adding DivePoints on the planner via the table.
Somewhere we broke this, most probably in the code that activated the planner to be used together as an 'add dive'. This commit makes the code workable again. There's one thing, though. if the model is empty, this will add something in the first point - it's behaving strangely. I'll try to fix this in a way that's invisible to the user, but overall, why are we inserting something in the first(0,0) time and depth? Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a07c3d62af
commit
2235da57a7
1 changed files with 6 additions and 0 deletions
|
@ -1149,6 +1149,12 @@ bool DivePlannerPointsModel::addGas(int o2, int he)
|
|||
int DivePlannerPointsModel::addStop(int milimeters, int minutes, int o2, int he, int ccpoint)
|
||||
{
|
||||
int row = divepoints.count();
|
||||
if (minutes == 0 && milimeters == 0 && row != 0){
|
||||
/* this is only possible if the user clicked on the 'plus' sign on the DivePoints Table */
|
||||
struct divedatapoint& t = divepoints.last();
|
||||
milimeters = t.depth;
|
||||
minutes = t.time + 600; // 10 minutes.
|
||||
}
|
||||
if (o2 != -1)
|
||||
if (!addGas(o2, he))
|
||||
qDebug("addGas failed"); // FIXME add error propagation
|
||||
|
|
Loading…
Add table
Reference in a new issue