summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-01-22 17:25:49 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-01-22 18:18:57 -0800
commit0196d9a220e4bdd989539f55b4d5736d189410d4 (patch)
tree5a4bde2be697ae462e193b3fe79f0240b74df65b /mobile-widgets
parentbfaeb22cc5e4397cab5e7acc283deaf0145121f1 (diff)
downloadsubsurface-0196d9a220e4bdd989539f55b4d5736d189410d4.tar.gz
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>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qml/DiveDetails.qml2
1 files changed, 1 insertions, 1 deletions
diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml
index be342886d..de8c29e40 100644
--- a/mobile-widgets/qml/DiveDetails.qml
+++ b/mobile-widgets/qml/DiveDetails.qml
@@ -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)