mobile: autocomplete location names

Add the capability to select the location name from a list, constructed
from the known dive sites in the logbook.

Fixes: #546

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
Jan Mulder 2017-11-22 16:19:44 +01:00 committed by Dirk Hohndel
parent ba773c811f
commit 64704d6e5a
4 changed files with 26 additions and 5 deletions

View file

@ -426,6 +426,23 @@ QStringList DiveObjectHelper::suitList() const
return suits;
}
QStringList DiveObjectHelper::locationList() const
{
QStringList locations;
struct dive *d;
struct dive_site *ds;
int i = 0;
for_each_dive (i, d) {
ds = get_dive_site_by_uuid(d->dive_site_uuid);
QString temp = ds->name;
if (!temp.isEmpty())
locations << temp;
}
locations.removeDuplicates();
locations.sort();
return locations;
}
QStringList DiveObjectHelper::buddyList() const
{
QStringList buddies;