From 697f9eb1d3074dcc2c29661c6f013e485de7ae5f Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Tue, 18 Oct 2022 15:09:54 +0200 Subject: [PATCH] Update subject/description string encoding from API. Hide spinner on ending call. --- .../components/conference/ConferenceModel.cpp | 2 +- .../conferenceInfo/ConferenceInfoModel.cpp | 6 +++--- .../src/components/content/ContentModel.cpp | 4 +++- .../src/components/history/HistoryModel.cpp | 4 ++-- linphone-app/ui/views/App/Calls/WaitingRoom.qml | 16 ++++++++-------- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/linphone-app/src/components/conference/ConferenceModel.cpp b/linphone-app/src/components/conference/ConferenceModel.cpp index 2e1582375..aad85a9ac 100644 --- a/linphone-app/src/components/conference/ConferenceModel.cpp +++ b/linphone-app/src/components/conference/ConferenceModel.cpp @@ -96,7 +96,7 @@ std::shared_ptr ConferenceModel::getConference()const{ } QString ConferenceModel::getSubject() const{ - return QString::fromStdString(mConference->getSubject()); + return Utils::coreStringToAppString(mConference->getSubject()); } QDateTime ConferenceModel::getStartDate() const{ diff --git a/linphone-app/src/components/conferenceInfo/ConferenceInfoModel.cpp b/linphone-app/src/components/conferenceInfo/ConferenceInfoModel.cpp index 923d03a79..583e8a855 100644 --- a/linphone-app/src/components/conferenceInfo/ConferenceInfoModel.cpp +++ b/linphone-app/src/components/conferenceInfo/ConferenceInfoModel.cpp @@ -162,7 +162,7 @@ QString ConferenceInfoModel::getOrganizer() const{ } QString ConferenceInfoModel::getSubject() const{ - return QString::fromStdString(mConferenceInfo->getSubject()); + return Utils::coreStringToAppString(mConferenceInfo->getSubject()); } QString ConferenceInfoModel::getDescription() const{ @@ -238,7 +238,7 @@ void ConferenceInfoModel::setDuration(const int& duration){ } void ConferenceInfoModel::setSubject(const QString& subject){ - mConferenceInfo->setSubject(subject.toStdString()); + mConferenceInfo->setSubject(Utils::appStringToCoreString(subject)); emit subjectChanged(); } @@ -248,7 +248,7 @@ void ConferenceInfoModel::setOrganizer(const QString& organizerAddress){ } void ConferenceInfoModel::setDescription(const QString& description){ - mConferenceInfo->setDescription(description.toStdString()); + mConferenceInfo->setDescription(Utils::appStringToCoreString(description)); emit descriptionChanged(); } diff --git a/linphone-app/src/components/content/ContentModel.cpp b/linphone-app/src/components/content/ContentModel.cpp index 105bd2c2a..1e16ee65b 100644 --- a/linphone-app/src/components/content/ContentModel.cpp +++ b/linphone-app/src/components/content/ContentModel.cpp @@ -89,7 +89,9 @@ QString ContentModel::getUtf8Text() const{ ConferenceInfoModel * ContentModel::getConferenceInfoModel(){ if( !mConferenceInfoModel && isIcalendar()){ - mConferenceInfoModel = ConferenceInfoModel::create(linphone::Factory::get()->createConferenceInfoFromIcalendarContent(mContent)); + auto conferenceInfo = linphone::Factory::get()->createConferenceInfoFromIcalendarContent(mContent); + if(conferenceInfo) + mConferenceInfoModel = ConferenceInfoModel::create(conferenceInfo); } return mConferenceInfoModel.get(); } diff --git a/linphone-app/src/components/history/HistoryModel.cpp b/linphone-app/src/components/history/HistoryModel.cpp index 9f38fda14..507135a5c 100644 --- a/linphone-app/src/components/history/HistoryModel.cpp +++ b/linphone-app/src/components/history/HistoryModel.cpp @@ -54,7 +54,7 @@ static inline void fillCallStartEntry (QVariantMap &dest, const shared_ptr(callLog->getStatus()); dest["isStart"] = true; if(callLog->getConferenceInfo()) - dest["title"] = QString::fromStdString(callLog->getConferenceInfo()->getSubject()); + dest["title"] = Utils::coreStringToAppString(callLog->getConferenceInfo()->getSubject()); dest["sipAddress"] = Utils::coreStringToAppString(callLog->getRemoteAddress()->asString()); dest["callId"] = Utils::coreStringToAppString(callLog->getCallId()); dest["wasConference"] = callLog->wasConference(); @@ -67,7 +67,7 @@ static inline void fillCallEndEntry (QVariantMap &dest, const shared_ptr(callLog->getStatus()); dest["isStart"] = false; if(callLog->getConferenceInfo()) - dest["title"] = QString::fromStdString(callLog->getConferenceInfo()->getSubject()); + dest["title"] = Utils::coreStringToAppString(callLog->getConferenceInfo()->getSubject()); dest["sipAddress"] = Utils::coreStringToAppString(callLog->getRemoteAddress()->asString()); dest["callId"] = Utils::coreStringToAppString(callLog->getCallId()); dest["wasConference"] = callLog->wasConference(); diff --git a/linphone-app/ui/views/App/Calls/WaitingRoom.qml b/linphone-app/ui/views/App/Calls/WaitingRoom.qml index 9c637d647..4b9887076 100644 --- a/linphone-app/ui/views/App/Calls/WaitingRoom.qml +++ b/linphone-app/ui/views/App/Calls/WaitingRoom.qml @@ -22,7 +22,7 @@ Rectangle { property CallModel callModel // Store the call for processing calling. property bool previewLoaderEnabled: callModel ? callModel.videoEnabled : true property var _sipAddressObserver: callModel ? SipAddressesModel.getSipAddressObserver(callModel.fullPeerAddress, callModel.fullLocalAddress) : undefined - property bool isEnding: callModel && callModel.status == CallModel.CallStatusEnded + property bool isEnded: callModel && callModel.status == CallModel.CallStatusEnded signal cancel() @@ -58,14 +58,14 @@ Rectangle { Layout.preferredWidth: WaitingRoomStyle.header.busyIndicator.width Layout.topMargin: 30 color: WaitingRoomStyle.header.busyIndicator.color - visible: mainItem.callModel && mainItem.callModel.status !== CallModel.CallStatusConnected + visible: mainItem.callModel && mainItem.callModel.status !== CallModel.CallStatusConnected && !mainItem.isEnded } Text{ Layout.alignment: Qt.AlignCenter text: mainItem.callModel - ? mainItem.isEnding - //: "Ending call" : status of the call in waiting room when the call end. + ? mainItem.isEnded + //: "Call ended" : status of the call in waiting room when the call end. ? qsTr("endCallStatus") : mainItem.callModel.isOutgoing //: "Outgoing call" : status of the call in waiting room when user is calling. @@ -86,7 +86,7 @@ Rectangle { font.pointSize: WaitingRoomStyle.elapsedTime.pointSize horizontalAlignment: Text.AlignHCenter width: parent.width - visible: mainItem.callModel && !mainItem.isEnding + visible: mainItem.callModel && !mainItem.isEnded Timer { interval: 1000 repeat: true @@ -151,7 +151,7 @@ Rectangle { : mainItem.callModel ? mainItem.callModel.conferenceModel : null - deactivateCamera: !mainItem.previewLoaderEnabled || mainItem.isEnding + deactivateCamera: !mainItem.previewLoaderEnabled || mainItem.isEnded /* image: mainItem._sipAddressObserver && mainItem._sipAddressObserver.contact && mainItem._sipAddressObserver.contact.vcard.avatar @@ -228,7 +228,7 @@ Rectangle { Layout.alignment: Qt.AlignCenter Layout.topMargin: 20 Layout.bottomMargin: 15 - visible: mainItem.conferenceInfoModel && !mainItem.isEnding + visible: mainItem.conferenceInfoModel && !mainItem.isEnded spacing: 30 TextButtonA { @@ -262,7 +262,7 @@ Rectangle { Layout.preferredHeight: actionsButtons.height Layout.bottomMargin: 30 Layout.topMargin: 20 - visible: !mainItem.isEnding + visible: !mainItem.isEnded // Action buttons RowLayout{ id: actionsButtons