Fixed moving a dive point between dive points

Fixed moving a dive point between dive points.
this fixes mostly everything that I have broked
by using a Qt Model instead of a linked list -
but a model is better to make everything updated
and only poke in one place. sharing code++. :)

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
Tomaz Canabrava 2013-08-26 17:15:48 -03:00
parent 3323fecea8
commit 65ab236948

View file

@ -988,7 +988,8 @@ int DivePlannerPointsModel::addStop(int meters, int minutes, const QString& gas,
void DivePlannerPointsModel::editStop(int row, divedatapoint newData)
{
divepoints[row] = newData;
emit dataChanged(createIndex(row, 0), createIndex(row, COLUMNS-1));
std::sort(divepoints.begin(), divepoints.end(), divePointsLessThan);
emit dataChanged(createIndex(0, 0), createIndex(rowCount()-1, COLUMNS-1));
}
divedatapoint DivePlannerPointsModel::at(int row)