diff options
author | Marco Martin <notmart@gmail.com> | 2017-04-13 19:57:22 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-04-13 11:05:26 -0700 |
commit | 71191f1294abdfcb40720707e4722173b62fdfac (patch) | |
tree | 43b850ee98e693da152c154aff9803f09b7044f9 /mobile-widgets | |
parent | a0c6cf5c89f94d189a71778eb79feb4b2825387c (diff) | |
download | subsurface-71191f1294abdfcb40720707e4722173b62fdfac.tar.gz |
QML UI: only assign actions in a declarative way
Assigning actions in an imperative way on component complete,
seems to cause a crash on some devices, assign declaratively
the whole list instead, hiding the gps related actions on
iOS as they are not supported on that platform.
Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qml/main.qml | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index 59c584df2..29ceed9f1 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -106,7 +106,7 @@ Kirigami.ApplicationWindow { bannerImageSource: "dive.jpg" - property list<QtObject> topActions: [ + actions: [ Kirigami.Action { text: qsTr("Dive list") onTriggered: { @@ -180,13 +180,11 @@ Kirigami.ApplicationWindow { } } } - } - ] // end topActions - - property list<QtObject> gpsActions: [ + }, Kirigami.Action { text: qsTr("GPS") enabled: manager.credentialStatus === QMLManager.VALID || manager.credentialStatus === QMLManager.VALID_EMAIL + visible: (Qt.platform.os !== "ios") Kirigami.Action { text: qsTr("GPS-tag dives") onTriggered: { @@ -230,10 +228,7 @@ Kirigami.ApplicationWindow { detailsWindow.endEditMode() } } - } - ] // end gpsActions - - property list<QtObject> bottomActions: [ + }, Kirigami.Action { text: qsTr("Developer") Kirigami.Action { @@ -263,21 +258,7 @@ Kirigami.ApplicationWindow { detailsWindow.endEditMode() } } - ] // end bottonActions - - Component.onCompleted: { - var createActions = new Array(0) - for (var i = 0; i < topActions.length; i++) - createActions.push(topActions[i]) - if (Qt.platform.os !== "ios") { - for (var i = 0; i < gpsActions.length; i++) - createActions.push(gpsActions[i]) - } - for (var i = 0; i < bottomActions.length; i++) - createActions.push(bottomActions[i]) - actions = createActions - print(actions) - } + ] // end actions MouseArea { height: childrenRect.height |