mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Only auto-fill coordinates for non-empty location strings
When editing the location string we try to be smart and automatically add the correct coordinates (assuming we have a location of this name already in the dive list). So if you return to the same dive spot you'll get the correct coordinates by default. But this creates bogus result if we allow an empty location to be matched, as it makes no sense to assume that all dives without a location name were at the same coordinates. Fixes #498 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
de9360e2e0
commit
dad3c5d9db
1 changed files with 5 additions and 2 deletions
|
@ -950,8 +950,11 @@ void MainTab::on_location_textChanged(const QString &text)
|
|||
dive_trip_t *currentTrip = *MainWindow::instance()->dive_list()->selectedTrips().begin();
|
||||
EDIT_TEXT(currentTrip->location, text);
|
||||
} else if (editMode == DIVE || editMode == ADD || editMode == MANUALLY_ADDED_DIVE) {
|
||||
if (!ui.coordinates->isModified() ||
|
||||
ui.coordinates->text().trimmed().isEmpty()) {
|
||||
// if we have a location text and haven't edited the coordinates, try to fill the coordinates
|
||||
// from the existing dives
|
||||
if (!text.isEmpty() &&
|
||||
(!ui.coordinates->isModified() ||
|
||||
ui.coordinates->text().trimmed().isEmpty())) {
|
||||
struct dive *dive;
|
||||
int i = 0;
|
||||
for_each_dive(i, dive) {
|
||||
|
|
Loading…
Add table
Reference in a new issue