summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Uwe Broulik <[email protected]>2016-11-03 16:33:17 +0100
committerKai Uwe Broulik <[email protected]>2016-11-03 16:33:17 +0100
commitd1133288c3357681b4a9c9976469df07d0802793 (patch)
tree2a529cdf2ea0da90621953d6ef531369987ca95d
parentb63b2924254a96fda6cd6535d295f82aba2249e2 (diff)
[Lock Screen] Don't assume last user is "New Session" entry
Ask the model instead. The entry might not be there if the user is not allowed to start a new session Differential Revision: https://phabricator.kde.org/D3232
-rw-r--r--lookandfeel/contents/lockscreen/LockScreenUi.qml3
1 files changed, 2 insertions, 1 deletions
diff --git a/lookandfeel/contents/lockscreen/LockScreenUi.qml b/lookandfeel/contents/lockscreen/LockScreenUi.qml
index 1b6f49a..a4c5f9f 100644
--- a/lookandfeel/contents/lockscreen/LockScreenUi.qml
+++ b/lookandfeel/contents/lockscreen/LockScreenUi.qml
@@ -202,7 +202,8 @@ PlasmaCore.ColorScope {
PlasmaComponents.Button {
Layout.fillWidth: true
- text: userListCurrentIndex == sessionsModel.count - 1 ? i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Start New Session") : i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Switch Session")
+ // the magic "-1" vtNumber indicates the "New Session" entry
+ text: userListCurrentModelData.vtNumber === -1 ? i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Start New Session") : i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Switch Session")
onClicked: initSwitchSession()
}