core: convert divesite strings to std::string

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-04 17:18:08 +02:00 committed by bstoeger
parent 3916125786
commit 7d3977481a
38 changed files with 181 additions and 222 deletions

View file

@ -1068,9 +1068,9 @@ bool QMLManager::checkLocation(DiveSiteChange &res, struct dive *d, QString loca
{
struct dive_site *ds = get_dive_site_for_dive(d);
bool changed = false;
QString oldLocation = get_dive_location(d);
QString oldLocation = QString::fromStdString(get_dive_location(d));
if (oldLocation != location) {
ds = get_dive_site_by_name(qPrintable(location), divelog.sites);
ds = get_dive_site_by_name(location.toStdString(), divelog.sites);
if (!ds && !location.isEmpty()) {
res.createdDs = std::make_unique<dive_site>(qPrintable(location));
res.changed = true;
@ -1817,9 +1817,7 @@ QString QMLManager::getVersion() const
QString QMLManager::getGpsFromSiteName(const QString &siteName)
{
struct dive_site *ds;
ds = get_dive_site_by_name(qPrintable(siteName), divelog.sites);
struct dive_site *ds = get_dive_site_by_name(siteName.toStdString(), divelog.sites);
if (!ds)
return QString();
return printGPSCoords(&ds->location);