mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
2adf120f69
commit
64753e0682
1 changed files with 2 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue