mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: correctly test if there are multiple buddies
The JS string function search returns the position of the string you search for and -1 if that string isn't found. Also, search allows regular expression, indexOf does just a string match. So let's use that as it is much faster. See issue #168 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
bfaeb22cc5
commit
0196d9a220
1 changed files with 1 additions and 1 deletions
|
@ -156,7 +156,7 @@ Kirigami.Page {
|
|||
airtemp = diveDetailsListView.currentItem.modelData.dive.airTemp
|
||||
watertemp = diveDetailsListView.currentItem.modelData.dive.waterTemp
|
||||
suitIndex = diveDetailsListView.currentItem.modelData.dive.suitList.indexOf(diveDetailsListView.currentItem.modelData.dive.suit)
|
||||
if (diveDetailsListView.currentItem.modelData.dive.buddy.search(",")) {
|
||||
if (diveDetailsListView.currentItem.modelData.dive.buddy.indexOf(",") > 0) {
|
||||
buddyIndex = diveDetailsListView.currentItem.modelData.dive.buddyList.indexOf("Multiple Buddies");
|
||||
} else {
|
||||
buddyIndex = diveDetailsListView.currentItem.modelData.dive.buddyList.indexOf(diveDetailsListView.currentItem.modelData.dive.buddy)
|
||||
|
|
Loading…
Add table
Reference in a new issue