Add more delay before closing call view on error call.

This commit is contained in:
Julien Wadel 2022-07-06 19:50:16 +02:00
parent 0c87c93ae9
commit 941a56f20e
6 changed files with 15 additions and 12 deletions

View file

@ -878,12 +878,12 @@ void CallModel::searchReceived(std::list<std::shared_ptr<linphone::SearchResult>
}
}
void CallModel::callEnded(){
void CallModel::endCall(){
if(mCall){
ChatRoomModel * model = getChatRoomModel();
if(model){
model->callEnded(mCall);
model->onCallEnded(mCall);
}else{// No chat rooms have been associated for this call. Search one in current chat room list
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
std::shared_ptr<linphone::ChatRoomParams> params = core->createDefaultChatRoomParams();
@ -894,7 +894,7 @@ void CallModel::callEnded(){
, participants);
QSharedPointer<ChatRoomModel> chatRoomModel= CoreManager::getInstance()->getTimelineListModel()->getChatRoomModel(chatRoom, false);
if(chatRoomModel)
chatRoomModel->callEnded(mCall);
chatRoomModel->onCallEnded(mCall);
}
}
}

View file

@ -188,7 +188,7 @@ public:
public slots:
// Set remote display name when a search has been done
void searchReceived(std::list<std::shared_ptr<linphone::SearchResult>> results);
void callEnded();
void endCall();
signals:
void callErrorChanged (const QString &callError);
@ -215,7 +215,6 @@ signals:
void transferAddressChanged (const QString &transferAddress);
void conferenceVideoLayoutChanged();
public:
void handleCallEncryptionChanged (const std::shared_ptr<linphone::Call> &call);

View file

@ -450,7 +450,7 @@ void CallsListModel::handleCallStateChanged (const shared_ptr<linphone::Call> &c
case linphone::Call::State::Error:{
if(call->dataExists("call-model")) {
CallModel * model = &call->getData<CallModel>("call-model");
model->callEnded();
model->endCall();
}
removeCall(call);
} break;
@ -519,9 +519,13 @@ void CallsListModel::removeCall (const shared_ptr<linphone::Call> &call) {
qWarning() << QStringLiteral("Unable to find call:") << call.get();
return;
}
QTimer::singleShot(DelayBeforeRemoveCall, this, [this, callModel] {
removeCallCb(callModel);
QTimer::singleShot( DelayBeforeRemoveCall , this, [this, callModel] {
if( callModel->getCallError() != ""){// We got an error, met more time to see it.
QTimer::singleShot( DelayBeforeRemoveCall , this, [this, callModel] {
removeCallCb(callModel);
});
}else
removeCallCb(callModel);
});
}

View file

@ -197,7 +197,7 @@ QQuickFramebufferObject::Renderer *Camera::createRenderer () const {
}else{
mIsWindowIdSet = true;
qDebug() << "[Camera] Added " << renderer << " at " << mWindowIdLocation << " for " << this;
QTimer::singleShot(1, this, &Camera::isReady);// Workaround for const createRenderer
QTimer::singleShot(1, this, &Camera::isReady);// Workaround for const createRenderer.
}
return renderer;
}

View file

@ -989,7 +989,7 @@ int ChatRoomModel::loadMoreEntries(){
//-------------------------------------------------
//-------------------------------------------------
void ChatRoomModel::callEnded(std::shared_ptr<linphone::Call> call){
void ChatRoomModel::onCallEnded(std::shared_ptr<linphone::Call> call){
if( call->getCallLog()->getStatus() == linphone::Call::Status::Missed)
addMissedCallsCount(call);
else{

View file

@ -170,7 +170,7 @@ public:
Q_INVOKABLE void resetMessageCount ();
void initEntries();
Q_INVOKABLE int loadMoreEntries(); // return new entries count
void callEnded(std::shared_ptr<linphone::Call> call);
void onCallEnded(std::shared_ptr<linphone::Call> call);
void updateNewMessageNotice(const int& count);
Q_INVOKABLE int loadTillMessage(ChatMessageModel * message);// Load all entries till message and return its index. -1 if not found.
static bool isTerminated(const std::shared_ptr<linphone::ChatRoom>& chatRoom);