From 24d85e2eb409b6c690b4103fb837f7ab75d6d58c Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Mon, 13 Mar 2023 15:09:22 +0100 Subject: [PATCH] - Conference layout refreshing on creation. - Crash and display of local conferences. --- CHANGELOG.md | 2 ++ linphone-app/src/components/call/CallModel.cpp | 7 ++++++- linphone-app/src/components/call/CallModel.hpp | 4 +--- .../components/participant/ParticipantDeviceProxyModel.cpp | 7 +++++-- linphone-app/ui/modules/Common/Form/Mosaic.qml | 1 + 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c98cdb59f..caf28799d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## 5.0.13 - undefined ### Fixed +- Conference layout refreshing on creation. +- Crash and display of local conferences. - Crash on chat rooms with default account. - Show display name for local accounts. diff --git a/linphone-app/src/components/call/CallModel.cpp b/linphone-app/src/components/call/CallModel.cpp index 784df5f96..80802b08f 100644 --- a/linphone-app/src/components/call/CallModel.cpp +++ b/linphone-app/src/components/call/CallModel.cpp @@ -252,6 +252,10 @@ QSharedPointer CallModel::getConferenceSharedModel(){ return mConferenceModel; } +bool CallModel::isInConference () const{ + return mIsInConference; +} + bool CallModel::isConference () const{ // Check status to avoid crash when requesting a conference on an ended call. bool isConf = false; @@ -498,6 +502,7 @@ void CallModel::handleCallStateChanged (const shared_ptr &call, auto conferenceInfo = CoreManager::getInstance()->getCore()->findConferenceInformationFromUri(getConferenceAddress()); if( conferenceInfo ){ mConferenceInfoModel = ConferenceInfoModel::create(conferenceInfo); + getConferenceSharedModel(); // emit new conferenceModel if it was not created. emit conferenceInfoModelChanged(); } } @@ -511,7 +516,7 @@ void CallModel::handleCallStateChanged (const shared_ptr &call, break; case linphone::Call::State::StreamsRunning: { - + getConferenceSharedModel(); if (!mWasConnected && CoreManager::getInstance()->getSettingsModel()->getAutomaticallyRecordCalls()) { startRecording(); mWasConnected = true; diff --git a/linphone-app/src/components/call/CallModel.hpp b/linphone-app/src/components/call/CallModel.hpp index db9cae4c7..cb6473a8e 100644 --- a/linphone-app/src/components/call/CallModel.hpp +++ b/linphone-app/src/components/call/CallModel.hpp @@ -144,9 +144,7 @@ public: ConferenceInfoModel* getConferenceInfoModel(); QSharedPointer getConferenceSharedModel(); - bool isInConference () const { - return mIsInConference; - } + bool isInConference () const; bool isConference () const; bool isOneToOne() const; diff --git a/linphone-app/src/components/participant/ParticipantDeviceProxyModel.cpp b/linphone-app/src/components/participant/ParticipantDeviceProxyModel.cpp index c8951ff0a..5ba0144e0 100644 --- a/linphone-app/src/components/participant/ParticipantDeviceProxyModel.cpp +++ b/linphone-app/src/components/participant/ParticipantDeviceProxyModel.cpp @@ -57,8 +57,11 @@ bool ParticipantDeviceProxyModel::lessThan (const QModelIndex &left, const QMode ParticipantDeviceModel *ParticipantDeviceProxyModel::getAt(int row){ - QModelIndex sourceIndex = mapToSource(this->index(row, 0)); - return sourceModel()->data(sourceIndex).value(); + if(row>=0){ + QModelIndex sourceIndex = mapToSource(this->index(row, 0)); + return sourceModel()->data(sourceIndex).value(); + }else + return nullptr; } ParticipantDeviceModel* ParticipantDeviceProxyModel::getActiveSpeakerModel(){ diff --git a/linphone-app/ui/modules/Common/Form/Mosaic.qml b/linphone-app/ui/modules/Common/Form/Mosaic.qml index 48ea6f1bb..0aec5d752 100644 --- a/linphone-app/ui/modules/Common/Form/Mosaic.qml +++ b/linphone-app/ui/modules/Common/Form/Mosaic.qml @@ -89,6 +89,7 @@ ColumnLayout{ if( columns != bestLayout[1]) columns = bestLayout[1] } + onItemCountChanged: updateLayout() property int computedWidth: (mainLayout.width - grid.margin ) / columns property int computedHeight: (mainLayout.height - grid.margin ) / rows cellWidth: Math.min(computedWidth, computedHeight)