Changeset 0196d9a2 in subsurface


Ignore:
Timestamp:
Jan 22, 2017, 6:18:57 PM (6 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
b15b3c1
Parents:
bfaeb22
git-author:
Dirk Hohndel <dirk@…> (01/22/17 17:25:49)
git-committer:
Dirk Hohndel <dirk@…> (01/22/17 18:18:57)
Message:

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@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mobile-widgets/qml/DiveDetails.qml

    r14b4c94 r0196d9a2  
    157157                watertemp = diveDetailsListView.currentItem.modelData.dive.waterTemp
    158158                suitIndex = diveDetailsListView.currentItem.modelData.dive.suitList.indexOf(diveDetailsListView.currentItem.modelData.dive.suit)
    159                 if (diveDetailsListView.currentItem.modelData.dive.buddy.search(",")) {
     159                if (diveDetailsListView.currentItem.modelData.dive.buddy.indexOf(",") > 0) {
    160160                        buddyIndex = diveDetailsListView.currentItem.modelData.dive.buddyList.indexOf("Multiple Buddies");
    161161                } else {
Note: See TracChangeset for help on using the changeset viewer.