Commit ebd8de84 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(src/components/call/CallModel): coding style

parent 16f90568
...@@ -153,13 +153,13 @@ void CallModel::takeSnapshot () { ...@@ -153,13 +153,13 @@ void CallModel::takeSnapshot () {
QString newName = QDateTime::currentDateTime().toString("yyyy-MM-dd_hh:mm:ss") + ".jpg"; QString newName = QDateTime::currentDateTime().toString("yyyy-MM-dd_hh:mm:ss") + ".jpg";
if (newName == oldName) { if (newName == oldName) {
qWarning() << "Unable to take snapshot. Wait one second."; qWarning() << QStringLiteral("Unable to take snapshot. Wait one second.");
return; return;
} }
oldName = newName; oldName = newName;
qInfo() << "Take snapshot of call:" << &mCall; qInfo() << QStringLiteral("Take snapshot of call:") << this;
mCall->takeVideoSnapshot( mCall->takeVideoSnapshot(
::Utils::qStringToLinphoneString( ::Utils::qStringToLinphoneString(
...@@ -172,7 +172,7 @@ void CallModel::startRecording () { ...@@ -172,7 +172,7 @@ void CallModel::startRecording () {
if (mRecording) if (mRecording)
return; return;
qInfo() << "Start recording call:" << &mCall; qInfo() << QStringLiteral("Start recording call:") << this;
mCall->startRecording(); mCall->startRecording();
mRecording = true; mRecording = true;
...@@ -182,7 +182,7 @@ void CallModel::startRecording () { ...@@ -182,7 +182,7 @@ void CallModel::startRecording () {
void CallModel::stopRecording () { void CallModel::stopRecording () {
if (mRecording) { if (mRecording) {
qInfo() << "Stop recording call:" << &mCall; qInfo() << QStringLiteral("Stop recording call:") << this;
mRecording = false; mRecording = false;
mCall->stopRecording(); mCall->stopRecording();
...@@ -199,8 +199,8 @@ void CallModel::handleCallStateChanged (const std::shared_ptr<linphone::Call> &c ...@@ -199,8 +199,8 @@ void CallModel::handleCallStateChanged (const std::shared_ptr<linphone::Call> &c
switch (state) { switch (state) {
case linphone::CallStateError: case linphone::CallStateError:
setCallErrorFromReason(call->getReason());
case linphone::CallStateEnd: case linphone::CallStateEnd:
setCallErrorFromReason(call->getReason());
stopAutoAnswerTimer(); stopAutoAnswerTimer();
mPausedByRemote = false; mPausedByRemote = false;
break; break;
...@@ -225,17 +225,24 @@ void CallModel::handleCallStateChanged (const std::shared_ptr<linphone::Call> &c ...@@ -225,17 +225,24 @@ void CallModel::handleCallStateChanged (const std::shared_ptr<linphone::Call> &c
break; break;
case linphone::CallStateUpdatedByRemote: case linphone::CallStateUpdatedByRemote:
if ( if (!mCall->getCurrentParams()->videoEnabled() && mCall->getRemoteParams()->videoEnabled()) {
!mCall->getCurrentParams()->videoEnabled() &&
mCall->getRemoteParams()->videoEnabled()
) {
mCall->deferUpdate(); mCall->deferUpdate();
emit videoRequested(); emit videoRequested();
} }
break; break;
default: case linphone::CallStateIdle:
case linphone::CallStateIncomingReceived:
case linphone::CallStateOutgoingInit:
case linphone::CallStateOutgoingProgress:
case linphone::CallStateOutgoingRinging:
case linphone::CallStateOutgoingEarlyMedia:
case linphone::CallStatePaused:
case linphone::CallStateIncomingEarlyMedia:
case linphone::CallStateUpdating:
case linphone::CallStateEarlyUpdatedByRemote:
case linphone::CallStateEarlyUpdating:
break; break;
} }
...@@ -309,6 +316,9 @@ void CallModel::setCallErrorFromReason (linphone::Reason reason) { ...@@ -309,6 +316,9 @@ void CallModel::setCallErrorFromReason (linphone::Reason reason) {
break; break;
} }
if (!mCallError.isEmpty())
qInfo() << QStringLiteral("Call terminated with error (%1):").arg(mCallError) << this;
emit callErrorChanged(mCallError); emit callErrorChanged(mCallError);
} }
...@@ -546,7 +556,7 @@ QString CallModel::iceStateToString (linphone::IceState state) const { ...@@ -546,7 +556,7 @@ QString CallModel::iceStateToString (linphone::IceState state) const {
return tr("iceStateHostConnection"); return tr("iceStateHostConnection");
case linphone::IceStateRelayConnection: case linphone::IceStateRelayConnection:
return tr("iceStateRelayConnection"); return tr("iceStateRelayConnection");
default:
return tr("iceStateInvalid");
} }
return tr("iceStateInvalid");
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment