mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-12 14:06:15 +00:00
Fixed entering a dive stop before another dive stop.
Fixed entering a dive stop before another dive stop, the correct way is to fix the position of them but this is easyer - I'll update the correct one in a couple of patches. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
parent
9d90034109
commit
760c14ac0c
1 changed files with 8 additions and 0 deletions
|
@ -959,6 +959,14 @@ void DivePlannerPointsModel::setStartTime(const QTime& t)
|
||||||
int DivePlannerPointsModel::addStop(int meters, int minutes, const QString& gas, int ccpoint)
|
int DivePlannerPointsModel::addStop(int meters, int minutes, const QString& gas, int ccpoint)
|
||||||
{
|
{
|
||||||
int row = divepoints.count();
|
int row = divepoints.count();
|
||||||
|
// check if there's already a new stop before this one:
|
||||||
|
Q_FOREACH(const divedatapoint& dp, divepoints){
|
||||||
|
if (dp.time > minutes ){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add the new stop
|
||||||
beginInsertRows(QModelIndex(), row, row);
|
beginInsertRows(QModelIndex(), row, row);
|
||||||
divedatapoint point;
|
divedatapoint point;
|
||||||
point.depth = meters;
|
point.depth = meters;
|
||||||
|
|
Loading…
Add table
Reference in a new issue