[master/Qt6] CallDuration should be reset to zero when call is finished or when a new one is started
In order to reproduce this:
- get an incoming call, accept it, let it continue for a few seconds, then close it
- start an outgoing call, the Active call screen still shows the duration at which the previous call ended
Looking into plasma-dialer/src/qml/call/CallPage.qml
L96-116
// time spent on call
Controls.Label {
Layout.fillWidth: true
Layout.minimumHeight: implicitHeight
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
font.pointSize: Kirigami.Theme.defaultFont.pointSize * 1.1
text: {
if (callDuration > 0) {
return secondsToTimeString(callDuration)
}
if (callIncoming) {
return i18n("Incoming...")
}
if (callActive) {
return i18n("Calling...")
}
return ''
}
visible: text !== ""
}
callDuration
is in the first if-clause, then it has higher priority, and being !=0 it gets shown, but in this case the right string would be "Calling..."
I think this should be fixed by resetting callDuration
to 0 when a call is finished. Setting it to 0 when a new call is started/received would also work, but I prefer the former.