diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-06-01 17:00:09 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-06-01 17:00:09 -0700 |
commit | 64753e0682d1fd008d9cdf573e78fe5ea862dcef (patch) | |
tree | f118d3249b81da107b5c11669edf677938fc7365 /qt-models | |
parent | 2adf120f695d276934413d8baca5caa358b3e97b (diff) | |
download | subsurface-64753e0682d1fd008d9cdf573e78fe5ea862dcef.tar.gz |
Fix dive site sorting
std::sort sorts [first,last) so last is excluded.
Also fix the mis-spelling of the compare function.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-models')
-rw-r--r-- | qt-models/divelocationmodel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-models/divelocationmodel.cpp b/qt-models/divelocationmodel.cpp index 3f8c486fe..05d68c27d 100644 --- a/qt-models/divelocationmodel.cpp +++ b/qt-models/divelocationmodel.cpp @@ -1,7 +1,7 @@ #include "divelocationmodel.h" #include "dive.h" -bool dive_site_less_then(dive_site *a, dive_site *b) +bool dive_site_less_than(dive_site *a, dive_site *b) { return QString(a->name) <= QString(b->name); } @@ -45,7 +45,7 @@ void LocationInformationModel::update() if (dive_site_table.nr) { beginInsertRows(QModelIndex(), 0, dive_site_table.nr); internalRowCount = dive_site_table.nr; - std::sort(dive_site_table.dive_sites, dive_site_table.dive_sites + dive_site_table.nr - 1, dive_site_less_then); + std::sort(dive_site_table.dive_sites, dive_site_table.dive_sites + dive_site_table.nr, dive_site_less_than); endInsertRows(); } } |