mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile cleanup: unduplicate code and do not loop over dives (3)
See e6e1473e6
. Exact same commit but here for the
list of divemaster. The careful reader will spot a
small addition to the clearDetailsEdit() QML function.
Two more field are cleared.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
parent
572fc47071
commit
83259008e7
7 changed files with 12 additions and 35 deletions
|
@ -275,6 +275,7 @@ void QMLManager::openLocalThenRemote(QString url)
|
|||
}
|
||||
buddyModel.updateModel(); emit buddyListChanged();
|
||||
suitModel.updateModel(); emit suitListChanged();
|
||||
divemasterModel.updateModel(); emit divemasterListChanged();
|
||||
}
|
||||
|
||||
void QMLManager::mergeLocalRepo()
|
||||
|
@ -1561,19 +1562,9 @@ QStringList QMLManager::buddyList() const
|
|||
return buddyModel.stringList();
|
||||
}
|
||||
|
||||
QStringList QMLManager::divemasterInit() const
|
||||
QStringList QMLManager::divemasterList() const
|
||||
{
|
||||
QStringList divemasters;
|
||||
struct dive *d;
|
||||
int i = 0;
|
||||
for_each_dive (i, d) {
|
||||
QString temp = d->divemaster;
|
||||
if (!temp.isEmpty())
|
||||
divemasters << d->divemaster;
|
||||
}
|
||||
divemasters.removeDuplicates();
|
||||
divemasters.sort();
|
||||
return divemasters;
|
||||
return divemasterModel.stringList();
|
||||
}
|
||||
|
||||
QStringList QMLManager::cylinderInit() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue