From 785005012d79118467abfb7a2e7b44aae7a534ca Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Tue, 16 Dec 2025 17:05:46 +0100 Subject: [PATCH] fix crashes due to persistent ChatCore stored in qml files --- Linphone/data/languages/de.ts | 62 +++++++++---------- Linphone/data/languages/en.ts | 62 +++++++++---------- Linphone/data/languages/fr.ts | 62 +++++++++---------- .../Control/Display/Chat/EphemeralEvent.qml | 5 +- .../view/Page/Form/Chat/SelectedChatView.qml | 3 +- .../Page/Layout/Chat/ConversationInfos.qml | 55 ++++++++-------- .../Layout/Chat/GroupChatInfoParticipants.qml | 8 +-- .../Page/Layout/Chat/ManageParticipants.qml | 7 +-- 8 files changed, 130 insertions(+), 134 deletions(-) diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index eca5cc4d..5479889b 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -3429,19 +3429,19 @@ Stellen Sie sicher, dass Sie keine sensiblen Informationen teilen! ConversationInfos - + one_one_infos_call "Appel" Anrufen - + one_one_infos_unmute "Sourdine" Stummschaltung aufheben - + one_one_infos_mute Stummschalten @@ -3451,121 +3451,121 @@ Stellen Sie sicher, dass Sie keine sensiblen Informationen teilen! Suchen - + group_infos_participants Teilnehmer (%1) - + group_infos_media_docs Medias & documents Medien & Dokumente - + group_infos_shared_medias Shared medias Geteilte Medien - + group_infos_shared_docs Shared documents Geteilte Dokumente - + group_infos_other_actions Other actions Weitere Aktionen - + group_infos_ephemerals Flüchtige Nachrichten: - + group_infos_enable_ephemerals Flüchtige Nachrichten aktivieren - + group_infos_meeting Schedule a meeting Meeting planen - + group_infos_leave_room Leave chat room Chat verlassen - + group_infos_leave_room_toast_title Leave Chat Room ? Chat verlassen? - + group_infos_leave_room_toast_message All the messages will be removed from the chat room. Do you want to continue ? Alle Nachrichten werden aus dem Chat entfernt. Möchten Sie fortfahren? - + group_infos_delete_history Delete history Verlauf löschen - + group_infos_delete_history_toast_title Delete history ? Verlauf löschen? - + group_infos_delete_history_toast_message All the messages will be removed from the chat room. Do you want to continue ? Alle Nachrichten werden aus dem Chat entfernt. Möchten Sie fortfahren? - + one_one_infos_open_contact Show contact Kontakt anzeigen - + one_one_infos_create_contact Create contact Kontakt erstellen - + one_one_infos_ephemerals Flüchtige Nachrichten: - + one_one_infos_enable_ephemerals Flüchtige Nachrichten aktivieren - + one_one_infos_delete_history Verlauf löschen - + one_one_infos_delete_history_toast_title Delete history ? Verlauf löschen? - + one_one_infos_delete_history_toast_message All the messages will be removed from the chat room. Do you want to continue ? Alle Nachrichten werden aus dem Chat entfernt. Möchten Sie fortfahren? @@ -4596,7 +4596,7 @@ Ablauf: %1 ManageParticipants - + group_infos_manage_participants Teilnehmer @@ -5874,37 +5874,37 @@ Um sie in einem kommerziellen Projekt zu aktivieren, kontaktieren Sie uns bitte. Gruppenanruf starten? - + unencrypted_conversation_warning This conversation is not encrypted ! Dieser Chat ist nicht verschlüsselt! - + reply_to_label Reply to %1 Auf %1 antworten - + shared_medias_title Shared medias Geteilte Medien - + shared_documents_title Shared documents Geteilte Dokumente - + forward_to_title Forward to… Weiterleiten an… - + conversations_title Conversations Konversationen diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index b04f291a..8393326f 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -3337,138 +3337,138 @@ Only your correspondent can decrypt them. ConversationInfos - + one_one_infos_call "Appel" Call - + one_one_infos_unmute "Sourdine" Unmute - + one_one_infos_mute Mute - + group_infos_participants Participants (%1) - + group_infos_media_docs Medias & documents Medias & documents - + group_infos_shared_medias Shared medias Shared medias - + group_infos_shared_docs Shared documents Shared documents - + group_infos_other_actions Other actions Other actions - + group_infos_ephemerals Ephemeral messages : - + group_infos_enable_ephemerals Enable ephemeral messages - + group_infos_meeting Schedule a meeting Schedule a meeting - + group_infos_leave_room Leave chat room Leave Chat Room - + group_infos_leave_room_toast_title Leave Chat Room ? Leave Chat Room ? - + group_infos_leave_room_toast_message All the messages will be removed from the chat room. Do you want to continue ? All the messages will be removed from the chat room. Do you want to continue ? - + group_infos_delete_history Delete history Delete history - + group_infos_delete_history_toast_title Delete history ? Delete history ? - + group_infos_delete_history_toast_message All the messages will be removed from the chat room. Do you want to continue ? All the messages will be removed from the chat room. Do you want to continue ? - + one_one_infos_open_contact Show contact Show contact - + one_one_infos_create_contact Create contact Create contact - + one_one_infos_ephemerals Ephemeral messages : - + one_one_infos_enable_ephemerals Enable ephemeral messages - + one_one_infos_delete_history Delete history - + one_one_infos_delete_history_toast_title Delete history ? Delete history ? - + one_one_infos_delete_history_toast_message All the messages will be removed from the chat room. Do you want to continue ? All the messages will be removed from the chat room. Do you want to continue ? @@ -4494,7 +4494,7 @@ Expiration : %1 ManageParticipants - + group_infos_manage_participants Participants @@ -5751,37 +5751,37 @@ To enable them in a commercial project, please contact us. Start a group call ? - + unencrypted_conversation_warning This conversation is not encrypted ! This conversation is not encrypted ! - + reply_to_label Reply to %1 Reply to %1 - + shared_medias_title Shared medias Shared medias - + shared_documents_title Shared documents Shared documents - + forward_to_title Forward to… Froward to… - + conversations_title Conversations Conversations diff --git a/Linphone/data/languages/fr.ts b/Linphone/data/languages/fr.ts index 504c2fc2..8004c0ad 100644 --- a/Linphone/data/languages/fr.ts +++ b/Linphone/data/languages/fr.ts @@ -3332,138 +3332,138 @@ en bout. Seul votre correspondant peut les déchiffrer. ConversationInfos - + one_one_infos_call "Appel" Appel - + one_one_infos_unmute "Sourdine" Réactiver les notifications - + one_one_infos_mute Sourdine - + group_infos_participants Participants (%1) - + group_infos_media_docs Medias & documents Medias & documents - + group_infos_shared_medias Shared medias Médias partagés - + group_infos_shared_docs Shared documents Documents partagés - + group_infos_other_actions Other actions Autres actions - + group_infos_ephemerals Messages éphémères : - + group_infos_enable_ephemerals Activer les messages éphémères - + group_infos_meeting Schedule a meeting Programmer une réunion - + group_infos_leave_room Leave chat room Quitter la conversation - + group_infos_leave_room_toast_title Leave Chat Room ? Quitter la conversation ? - + group_infos_leave_room_toast_message All the messages will be removed from the chat room. Do you want to continue ? Vous ne recevrez ni pourrez envoyer des messages dans cette conversation, quitter ? - + group_infos_delete_history Delete history Supprimer l'historique - + group_infos_delete_history_toast_title Delete history ? Supprimer l'historique ? - + group_infos_delete_history_toast_message All the messages will be removed from the chat room. Do you want to continue ? Tous les messages seront supprimés. Souhaitez-vous continuer ? - + one_one_infos_open_contact Show contact Voir le contact - + one_one_infos_create_contact Create contact Créer un contact - + one_one_infos_ephemerals Messages éphémères : - + one_one_infos_enable_ephemerals Activer les messages éphémères - + one_one_infos_delete_history Supprimer l'historique - + one_one_infos_delete_history_toast_title Delete history ? Supprimer l'historique ? - + one_one_infos_delete_history_toast_message All the messages will be removed from the chat room. Do you want to continue ? Tous les messages seront supprimés. Souhaitez-vous continuer ? @@ -4489,7 +4489,7 @@ Expiration : %1 ManageParticipants - + group_infos_manage_participants Participants @@ -5746,37 +5746,37 @@ Pour les activer dans un projet commercial, merci de nous contacter.Démarrer un appel de groupe ? - + unencrypted_conversation_warning This conversation is not encrypted ! Cette conversation n'est pas chiffrée ! - + reply_to_label Reply to %1 Réponse à %1 - + shared_medias_title Shared medias Médias partagés - + shared_documents_title Shared documents Documents partagés - + forward_to_title Forward to… Transférer à… - + conversations_title Conversations Conversations diff --git a/Linphone/view/Control/Display/Chat/EphemeralEvent.qml b/Linphone/view/Control/Display/Chat/EphemeralEvent.qml index 9bec8bec..68db83cb 100644 --- a/Linphone/view/Control/Display/Chat/EphemeralEvent.qml +++ b/Linphone/view/Control/Display/Chat/EphemeralEvent.qml @@ -7,8 +7,7 @@ import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils Rectangle { anchors.centerIn: parent property EventLogGui eventLogGui - property var eventLogCore: eventLogGui.core - visible: eventLogCore.handled + visible: eventLogGui.core.handled height: row.height + Utils.getSizeWithScreenRatio(15) width: row.width + Utils.getSizeWithScreenRatio(15) radius: Utils.getSizeWithScreenRatio(10) @@ -27,7 +26,7 @@ Rectangle { } Text { id: message - text: eventLogCore.eventDetails + text: eventLogGui.core.eventDetails font: Typography.p3 color: DefaultStyle.main2_400 } diff --git a/Linphone/view/Page/Form/Chat/SelectedChatView.qml b/Linphone/view/Page/Form/Chat/SelectedChatView.qml index 38f68de4..d5d52138 100644 --- a/Linphone/view/Page/Form/Chat/SelectedChatView.qml +++ b/Linphone/view/Page/Form/Chat/SelectedChatView.qml @@ -53,8 +53,7 @@ FocusScope { let addresses = []; for (let i = 0; i < sourceList.length; ++i) { const participantGui = sourceList[i] - const participantCore = participantGui.core - addresses.push(participantCore.sipAddress) + addresses.push(participantGui.core.sipAddress) } UtilsCpp.createGroupCall(mainItem.chat?.core.title, addresses) } diff --git a/Linphone/view/Page/Layout/Chat/ConversationInfos.qml b/Linphone/view/Page/Layout/Chat/ConversationInfos.qml index 4457055b..04d60570 100644 --- a/Linphone/view/Page/Layout/Chat/ConversationInfos.qml +++ b/Linphone/view/Page/Layout/Chat/ConversationInfos.qml @@ -13,11 +13,10 @@ import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils ColumnLayout { id: mainItem property ChatGui chatGui - property var chatCore: chatGui.core - property var contactObj: chatGui ? UtilsCpp.findFriendByAddress(mainItem.chatCore.peerAddress) : null + property var contactObj: chatGui ? UtilsCpp.findFriendByAddress(mainItem.chatGui.core.peerAddress) : null property FriendGui contact: contactObj ? contactObj.value : null property bool isAppFriend: contact && contact.core.isAppFriend - property bool isGroup: chatCore && chatCore.isGroupChat + property bool isGroup: chatGui && chatGui.core.isGroupChat spacing: 0 signal ephemeralSettingsRequested() signal showSharedFilesRequested(bool showMedias) @@ -29,7 +28,7 @@ ColumnLayout { Avatar { Layout.alignment: Qt.AlignHCenter contact: mainItem.contact - displayNameVal: mainItem.chatCore.avatarUri + displayNameVal: mainItem.chatGui.core.avatarUri secured: mainItem.chatGui && mainItem.chatGui.core.isSecured Layout.preferredWidth: Utils.getSizeWithScreenRatio(100) Layout.preferredHeight: Utils.getSizeWithScreenRatio(100) @@ -51,7 +50,7 @@ ColumnLayout { popup.contentItem: RowLayout { Text { id: chatroomaddress - text: chatCore?.chatRoomAddress || "" + text: chatGui?.core?.chatRoomAddress || "" } SmallButton { icon.source: AppIcons.copy @@ -70,10 +69,10 @@ ColumnLayout { RowLayout { id: titleMainItem property bool isEditingSubject: false - property bool canEditSubject: mainItem.chatCore.meAdmin && mainItem.chatCore.isGroupChat + property bool canEditSubject: mainItem.chatGui.core.meAdmin && mainItem.chatGui.core.isGroupChat function saveSubject() { - mainItem.chatCore.lSetSubject(title.text) + mainItem.chatGui.core.lSetSubject(title.text) } Item { @@ -96,7 +95,7 @@ ColumnLayout { anchors.margins: 6 font: Typography.p1 color: DefaultStyle.main2_700 - text: mainItem.chatCore.title || "" + text: mainItem.chatGui.core.title || "" enabled: titleMainItem.isEditingSubject wrapMode: TextEdit.Wrap horizontalAlignment: Text.AlignHCenter @@ -142,7 +141,7 @@ ColumnLayout { Text { font: Typography.p1 color: DefaultStyle.main2_700 - text: mainItem.chatCore.title || "" + text: mainItem.chatGui.core.title || "" } } @@ -156,7 +155,7 @@ ColumnLayout { Text { font: Typography.p3 color: DefaultStyle.main2_700 - text: SettingsCpp.hideSipAddresses ? UtilsCpp.getUsername(mainItem.chatCore.peerAddress) : mainItem.chatCore.peerAddress + text: SettingsCpp.hideSipAddresses ? UtilsCpp.getUsername(mainItem.chatGui.core.peerAddress) : mainItem.chatGui.core.peerAddress Layout.alignment: Qt.AlignHCenter Layout.topMargin: Utils.getSizeWithScreenRatio(5) } @@ -171,7 +170,7 @@ ColumnLayout { } RowLayout { - visible: !mainItem.chatCore.isReadOnly + visible: !mainItem.chatGui.core.isReadOnly spacing: Utils.getSizeWithScreenRatio(10) Layout.alignment: Qt.AlignHCenter Layout.topMargin: Utils.getSizeWithScreenRatio(30) @@ -200,11 +199,11 @@ ColumnLayout { Layout.maximumWidth: Utils.getSizeWithScreenRatio(130) button.icon.width: Utils.getSizeWithScreenRatio(24) button.icon.height: Utils.getSizeWithScreenRatio(24) - button.icon.source: mainItem.chatCore.muted ? AppIcons.bell : AppIcons.bellSlash + button.icon.source: mainItem.chatGui.core.muted ? AppIcons.bell : AppIcons.bellSlash //: "Sourdine" - label: mainItem.chatCore.muted ? qsTr("one_one_infos_unmute") : qsTr("one_one_infos_mute") + label: mainItem.chatGui.core.muted ? qsTr("one_one_infos_unmute") : qsTr("one_one_infos_mute") button.onClicked: { - mainItem.chatCore.muted = !mainItem.chatCore.muted + mainItem.chatGui.core.muted = !mainItem.chatGui.core.muted } } LabelButton { @@ -232,12 +231,12 @@ ColumnLayout { : qsTr("one_one_infos_create_contact") button.onClicked: { if (mainItem.isGroup) - UtilsCpp.getMainWindow().scheduleMeeting(mainItem.chatCore.title, mainItem.chatCore.participantsAddresses) + UtilsCpp.getMainWindow().scheduleMeeting(mainItem.chatGui.core.title, mainItem.chatGui.core.participantsAddresses) else { if (mainItem.isAppFriend) mainWindow.displayContactPage(mainItem.contact.core.defaultAddress) else - mainWindow.displayCreateContactPage("",mainItem.chatCore.peerAddress) + mainWindow.displayCreateContactPage("",mainItem.chatGui.core.peerAddress) } } } @@ -269,13 +268,13 @@ ColumnLayout { active: mainItem.isGroup sourceComponent: GroupChatInfoParticipants { Layout.fillWidth: true - title: qsTr("group_infos_participants").arg(mainItem.chatCore.participants.length) - participants: mainItem.chatCore.participants - chatCore: mainItem.chatCore + title: qsTr("group_infos_participants").arg(mainItem.chatGui.core.participants.length) + participants: mainItem.chatGui.core.participants + chatGui: mainItem.chatGui onManageParticipantsRequested: mainItem.manageParticipantsRequested() } Connections { - target: mainItem.chatCore + target: mainItem.chatGui.core onParticipantsChanged : { // hacky reload to update intric height participantLoader.active = false participantLoader.active = true @@ -321,8 +320,8 @@ ColumnLayout { ? [ { icon: AppIcons.clockCountDown, - visible: !mainItem.chatCore.isReadOnly, - text: mainItem.chatCore.ephemeralEnabled ? qsTr("group_infos_ephemerals")+UtilsCpp.getEphemeralFormatedTime(mainItem.chatCore.ephemeralLifetime) : qsTr("group_infos_enable_ephemerals"), + visible: !mainItem.chatGui.core.isReadOnly, + text: mainItem.chatGui.core.ephemeralEnabled ? qsTr("group_infos_ephemerals")+UtilsCpp.getEphemeralFormatedTime(mainItem.chatGui.core.ephemeralLifetime) : qsTr("group_infos_enable_ephemerals"), color: DefaultStyle.main2_600, showRightArrow: false, action: function() { @@ -331,7 +330,7 @@ ColumnLayout { }, { icon: AppIcons.signOut, - visible: !mainItem.chatCore.isReadOnly, + visible: !mainItem.chatGui.core.isReadOnly, //: Leave chat room text: qsTr("group_infos_leave_room"), color: DefaultStyle.main2_600, @@ -344,7 +343,7 @@ ColumnLayout { "", function(confirmed) { if (confirmed) { - mainItem.chatCore.lLeave() + mainItem.chatGui.core.lLeave() } }) } @@ -364,7 +363,7 @@ ColumnLayout { "", function(confirmed) { if (confirmed) { - mainItem.chatCore.lDeleteHistory() + mainItem.chatGui.core.lDeleteHistory() } }) } @@ -373,8 +372,8 @@ ColumnLayout { : [ { icon: AppIcons.clockCountDown, - visible: !mainItem.chatCore.isReadOnly, - text: mainItem.chatCore.ephemeralEnabled ? qsTr("one_one_infos_ephemerals")+UtilsCpp.getEphemeralFormatedTime(mainItem.chatCore.ephemeralLifetime) : qsTr("one_one_infos_enable_ephemerals"), + visible: !mainItem.chatGui.core.isReadOnly, + text: mainItem.chatGui.core.ephemeralEnabled ? qsTr("one_one_infos_ephemerals")+UtilsCpp.getEphemeralFormatedTime(mainItem.chatGui.core.ephemeralLifetime) : qsTr("one_one_infos_enable_ephemerals"), color: DefaultStyle.main2_600, showRightArrow: false, action: function() { @@ -395,7 +394,7 @@ ColumnLayout { "", function(confirmed) { if (confirmed) { - mainItem.chatCore.lDeleteHistory() + mainItem.chatGui.core.lDeleteHistory() } }) } diff --git a/Linphone/view/Page/Layout/Chat/GroupChatInfoParticipants.qml b/Linphone/view/Page/Layout/Chat/GroupChatInfoParticipants.qml index fcf8bb30..d5531865 100644 --- a/Linphone/view/Page/Layout/Chat/GroupChatInfoParticipants.qml +++ b/Linphone/view/Page/Layout/Chat/GroupChatInfoParticipants.qml @@ -15,10 +15,10 @@ ColumnLayout { id: mainItem property var title: String property var participants - property var chatCore + property ChatGui chatGui signal manageParticipantsRequested() - property bool isGroupEditable: chatCore && chatCore.meAdmin && !chatCore.isReadOnly + property bool isGroupEditable: chatGui && chatGui.core.meAdmin && !chatGui.core.isReadOnly RowLayout { Text { @@ -145,7 +145,7 @@ ColumnLayout { icon.height: Utils.getSizeWithScreenRatio(32) onClicked: { detailOptions.close() - mainItem.chatCore.lToggleParticipantAdminStatusAtIndex(index) + mainItem.chatGui.core.lToggleParticipantAdminStatusAtIndex(index) } } IconLabelButton { @@ -182,7 +182,7 @@ ColumnLayout { "", function(confirmed) { if (confirmed) { - mainItem.chatCore.lRemoveParticipantAtIndex(index) + mainItem.chatGui.core.lRemoveParticipantAtIndex(index) } }) } diff --git a/Linphone/view/Page/Layout/Chat/ManageParticipants.qml b/Linphone/view/Page/Layout/Chat/ManageParticipants.qml index eec1eb06..9962e331 100644 --- a/Linphone/view/Page/Layout/Chat/ManageParticipants.qml +++ b/Linphone/view/Page/Layout/Chat/ManageParticipants.qml @@ -13,7 +13,6 @@ import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils Rectangle { id: mainItem property ChatGui chatGui - property var chatCore: chatGui.core Layout.fillHeight: true Layout.fillWidth: true Layout.topMargin: Utils.getSizeWithScreenRatio(9) @@ -37,7 +36,7 @@ Rectangle { style: ButtonStyle.noBackground icon.source: AppIcons.leftArrow onClicked: { - mainItem.chatCore.lSetParticipantsAddresses(manageParticipantsLayout.selectedParticipants) + mainItem.chatGui.core.lSetParticipantsAddresses(manageParticipantsLayout.selectedParticipants) mainItem.done() } } @@ -56,11 +55,11 @@ Rectangle { Layout.topMargin: Utils.getSizeWithScreenRatio(9) Layout.bottomMargin: Utils.getSizeWithScreenRatio(17) Layout.alignment: Qt.AlignVCenter - selectedParticipants: mainItem.chatCore.participantsAddresses + selectedParticipants: mainItem.chatGui.core.participantsAddresses focus: true onVisibleChanged: { if (visible) - selectedParticipants = mainItem.chatCore.participantsAddresses + selectedParticipants = mainItem.chatGui.core.participantsAddresses } } Item {