From 581907613018bf9d69d80ef359a650e66dbab244 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 28 Dec 2018 10:22:10 +0100 Subject: Mobile: fix editing dive site Commit 68961a169efc37039cd3fda334efb9ad9927444f made it impossible to edit a dive site on mobile if a dive-site was already set: If divesite was non-null, no actions were taken. Remove the conditional. Reported-by: Miika Turkia Signed-off-by: Berthold Stoeger --- mobile-widgets/qmlmanager.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 8abfd3b51..4280d05bc 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -876,11 +876,9 @@ bool QMLManager::checkLocation(DiveObjectHelper *myDive, struct dive *d, QString qDebug() << "checkLocation" << location << "gps" << gps << "dive had" << myDive->location() << "gps" << myDive->gas(); if (myDive->location() != location) { diveChanged = true; - if (!ds) - ds = get_dive_site_by_name(qPrintable(location)); - if (!ds && !location.isEmpty()) { + ds = get_dive_site_by_name(qPrintable(location)); + if (!ds && !location.isEmpty()) ds = create_dive_site(qPrintable(location), d->when); - } d->dive_site = ds; } // now make sure that the GPS coordinates match - if the user changed the name but not -- cgit v1.2.3-70-g09d2