From 9bf230266eae327533120c03e121e43c27265290 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Wed, 13 Sep 2023 10:57:02 +0200 Subject: [PATCH] Crash fixes on ZRTP popup if call has been end. Close popup on end. Fix random crash on SettingsModel qml coming from uninitialized model. --- linphone-app/src/components/call/CallModel.cpp | 2 +- .../Linphone/Dialog/ZrtpTokenAuthenticationDialog.qml | 7 +++++++ linphone-app/ui/views/App/Main/MainWindowMenuBar.qml | 3 ++- linphone-app/ui/views/App/Main/MainWindowTopMenuBar.qml | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/linphone-app/src/components/call/CallModel.cpp b/linphone-app/src/components/call/CallModel.cpp index 9a1ac1bb9..cfc488e87 100644 --- a/linphone-app/src/components/call/CallModel.cpp +++ b/linphone-app/src/components/call/CallModel.cpp @@ -940,7 +940,7 @@ void CallModel::sendDtmf (const QString &dtmf) { // ----------------------------------------------------------------------------- void CallModel::verifyAuthenticationToken (bool verify) { - if(mCall) + if(mCall && getStatus() != CallStatusEnded) mCall->setAuthenticationTokenVerified(verify); emit securityUpdated(); } diff --git a/linphone-app/ui/modules/Linphone/Dialog/ZrtpTokenAuthenticationDialog.qml b/linphone-app/ui/modules/Linphone/Dialog/ZrtpTokenAuthenticationDialog.qml index 4d6a65552..c7a2ecb80 100644 --- a/linphone-app/ui/modules/Linphone/Dialog/ZrtpTokenAuthenticationDialog.qml +++ b/linphone-app/ui/modules/Linphone/Dialog/ZrtpTokenAuthenticationDialog.qml @@ -17,6 +17,7 @@ DialogPlus { property alias localSas: localSasText.text property alias remoteSas : remoteSasText.text + buttons: [ TextButtonA { //: 'Later' : Button label to do something in another time. @@ -46,6 +47,12 @@ DialogPlus { radius: 10 onCallChanged: if(!call) exit(0) Component.onCompleted: if( !localSas || !remoteSas) mainItem.exit(0) + + + Connections { + target: call + onStatusChanged: if (status === CallModel.CallStatusEnded) exit(0) + } ColumnLayout { id:columnLayout diff --git a/linphone-app/ui/views/App/Main/MainWindowMenuBar.qml b/linphone-app/ui/views/App/Main/MainWindowMenuBar.qml index e974df614..b6220b88f 100644 --- a/linphone-app/ui/views/App/Main/MainWindowMenuBar.qml +++ b/linphone-app/ui/views/App/Main/MainWindowMenuBar.qml @@ -57,7 +57,7 @@ Item { Shortcut { id: recordingsShortcut - onActivated: menuParent.displayRecordings() + onActivated: if(CoreManager.initialized && SettingsModel.callRecorderEnabled) menuParent.displayRecordings() } // --------------------------------------------------------------------------- @@ -75,6 +75,7 @@ Item { } MenuItem{ + visible: CoreManager.initialized && SettingsModel.callRecorderEnabled //: 'Recordings' : Label for the recordings menu. text: qsTr('recordings') onTriggered: recordingsShortcut.onActivated() diff --git a/linphone-app/ui/views/App/Main/MainWindowTopMenuBar.qml b/linphone-app/ui/views/App/Main/MainWindowTopMenuBar.qml index ed4ae1d25..8381b4ea7 100644 --- a/linphone-app/ui/views/App/Main/MainWindowTopMenuBar.qml +++ b/linphone-app/ui/views/App/Main/MainWindowTopMenuBar.qml @@ -28,6 +28,7 @@ MenuBar { } MenuItem { + visible: CoreManager.initialized && SettingsModel.callRecorderEnabled //: 'Recordings' : Label for the recordings menu. text: qsTr('recordings') role: MenuItem.ApplicationSpecificRole