diff options
-rw-r--r-- | divesite.c | 1 | ||||
-rw-r--r-- | qt-models/divelocationmodel.cpp | 6 |
2 files changed, 3 insertions, 4 deletions
diff --git a/divesite.c b/divesite.c index f7f6afea1..fbf01bf77 100644 --- a/divesite.c +++ b/divesite.c @@ -103,7 +103,6 @@ uint32_t create_dive_site(const char *name) uint32_t create_dive_site_with_gps(const char *name, degrees_t latitude, degrees_t longitude) { struct dive_site *ds = alloc_dive_site(); - ds->uuid = dive_site_getUniqId(); ds->name = copy_string(name); ds->latitude = latitude; ds->longitude = longitude; diff --git a/qt-models/divelocationmodel.cpp b/qt-models/divelocationmodel.cpp index 234b4f16c..c917cddf1 100644 --- a/qt-models/divelocationmodel.cpp +++ b/qt-models/divelocationmodel.cpp @@ -44,7 +44,7 @@ void LocationInformationModel::update() { beginResetModel(); internalRowCount = dive_site_table.nr; - std::sort(dive_site_table.dive_sites, dive_site_table.dive_sites + dive_site_table.nr, dive_site_less_than); + qSort(dive_site_table.dive_sites, dive_site_table.dive_sites + dive_site_table.nr, dive_site_less_than); endResetModel(); } @@ -55,8 +55,8 @@ int32_t LocationInformationModel::addDiveSite(const QString& name, int lon, int longitude.udeg = lon; beginInsertRows(QModelIndex(), dive_site_table.nr, dive_site_table.nr); - int32_t uuid = create_dive_site_with_gps(name.toUtf8().data(), latitude, longitude); - std::sort(dive_site_table.dive_sites, dive_site_table.dive_sites + dive_site_table.nr, dive_site_less_than); + uint32_t uuid = create_dive_site_with_gps(name.toUtf8().data(), latitude, longitude); + qSort(dive_site_table.dive_sites, dive_site_table.dive_sites + dive_site_table.nr, dive_site_less_than); internalRowCount = dive_site_table.nr; endInsertRows(); return uuid; |