From 64753e0682d1fd008d9cdf573e78fe5ea862dcef Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 1 Jun 2015 17:00:09 -0700 Subject: 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 --- qt-models/divelocationmodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-models') 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(); } } -- cgit v1.2.3-70-g09d2