Try to download content message if requested, even if the message state is not right.

Fix SIP address selection on search bars (Qt bug on models)
This commit is contained in:
Julien Wadel 2021-12-20 14:59:53 +01:00
parent 8cf52f8cab
commit 9f52ed6a88
3 changed files with 12 additions and 8 deletions

View file

@ -201,8 +201,7 @@ void ContentModel::downloadFile(){
break;
default:
qWarning() << QStringLiteral("Unable to download file of entry %1. It was not uploaded.").arg(mChatMessageModel->getState());
return;
qWarning() << QStringLiteral("Wrong message state when requesting downloading, state=%1.").arg(mChatMessageModel->getState());
}
bool soFarSoGood;
QString filename = getName();//mFileTransfertContent->getName();

View file

@ -86,7 +86,7 @@ Rectangle{
anchors.left: parent.left
anchors.right: parent.right
model: ContentProxyModel{
chatMessageModel: replyPreviewBlock.chatRoomModel.reply
chatMessageModel: replyPreviewBlock.chatRoomModel && replyPreviewBlock.chatRoomModel.reply
}
height: contentHeight

View file

@ -124,12 +124,14 @@ ScrollableListView {
visible: modelData.visible
onClicked: modelData.handler({
onClicked: sipAddressesView.actions[index].handler({ // Do not use modelData on functions : Qt bug
sipAddress: sipAddressesView.interpretableSipAddress
})
Icon{
visible: modelData.secure>0 &&
(modelData.secureIconVisibleHandler ? modelData.secureIconVisibleHandler({ sipAddress : sipAddressesView.interpretableSipAddress}) : true)
// Do not use modelData on functions : Qt bug
(sipAddressesView.actions[index].secureIconVisibleHandler ? sipAddressesView.actions[index].secureIconVisibleHandler({ sipAddress : sipAddressesView.interpretableSipAddress}) : true)
icon: 'secure_on'
iconSize:15
anchors.right:parent.right
@ -285,12 +287,15 @@ ScrollableListView {
colorSet: modelData.colorSet
tooltipText:modelData.tooltipText?modelData.tooltipText:''
visible: modelData.visible
onClicked: {
modelData.handler(sipAddressEntry.entry)
onClicked: {// Do not use modelData on functions : Qt bug
sipAddressesView.actions[index].handler(sipAddressEntry.entry)
}
Icon{
visible: modelData.secure>0 &&
(modelData.secureIconVisibleHandler ? modelData.secureIconVisibleHandler(sipAddressEntry.entry) : true)
// Do not use modelData on functions : Qt bug
(sipAddressesView.actions[index].secureIconVisibleHandler ? sipAddressesView.actions[index].secureIconVisibleHandler(sipAddressEntry.entry) : true)
icon: 'secure_on'
iconSize:15
anchors.right:parent.right