diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-08-26 17:15:48 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-08-26 17:15:48 -0300 |
commit | 65ab2369488a2526fbadd156ef92ab4fd1d1d04a (patch) | |
tree | caa048a2044ff29157276024fd3cfa65ceedbb20 /qt-ui | |
parent | 3323fecea86fdf3434d54ebfb88ae37b9812f5c5 (diff) | |
download | subsurface-65ab2369488a2526fbadd156ef92ab4fd1d1d04a.tar.gz |
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>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/diveplanner.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 4752a9f2b..00e522602 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -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) |