mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile cleanup: restyle construction of locationlist
See also e6e1473e6
. The construction of the locationlist
was not the same as the 3 previous lists, and it needs
the inclusion of a new model file (divelocationmodel.cpp)
in the mobile app. In addition, as the mobile app is mainly
interested in a simple stringList (model) to populate a HintsText
field (or maybe later a combobox), this stringlist is added
to the model, to easy interfacing with QML.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
parent
83259008e7
commit
494ad26540
8 changed files with 24 additions and 24 deletions
|
@ -410,21 +410,3 @@ QString DiveObjectHelper::firstGas() const
|
|||
gas = get_gas_string(m_dive->cylinder[0].gasmix);
|
||||
return gas;
|
||||
}
|
||||
|
||||
QStringList DiveObjectHelper::locationList() const
|
||||
{
|
||||
QStringList locations;
|
||||
struct dive *d;
|
||||
struct dive_site *ds;
|
||||
int i = 0;
|
||||
for_each_dive (i, d) {
|
||||
if ((ds = get_dive_site_by_uuid(d->dive_site_uuid)) != NULL) {
|
||||
QString temp = ds->name;
|
||||
if (!temp.isEmpty())
|
||||
locations << temp;
|
||||
}
|
||||
}
|
||||
locations.removeDuplicates();
|
||||
locations.sort();
|
||||
return locations;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue