Skip to content
Snippets Groups Projects
Commit 6fecef23 authored by Emmanuel Lepage Vallee's avatar Emmanuel Lepage Vallee
Browse files

[ #30839 ] Cleanup, documentation

parent 269faa56
Branches
No related tags found
No related merge requests found
...@@ -792,7 +792,7 @@ Call::State Call::stateChanged(const QString& newStateName) ...@@ -792,7 +792,7 @@ Call::State Call::stateChanged(const QString& newStateName)
} //stateChanged } //stateChanged
///An account have been performed ///An account have been performed
Call::State Call::actionPerformed(Call::Action action) Call::State Call::performAction(Call::Action action)
{ {
const Call::State previousState = m_CurrentState; const Call::State previousState = m_CurrentState;
//update the state //update the state
......
...@@ -264,7 +264,7 @@ public: ...@@ -264,7 +264,7 @@ public:
//Automated function //Automated function
Call::State stateChanged(const QString & newState); Call::State stateChanged(const QString & newState);
Call::State actionPerformed(Call::Action action); Call::State performAction(Call::Action action);
//Setters //Setters
void setConference ( bool value ); void setConference ( bool value );
......
...@@ -290,7 +290,7 @@ Call* CallModel::addIncomingCall(const QString& callId) ...@@ -290,7 +290,7 @@ Call* CallModel::addIncomingCall(const QString& callId)
//Call without account is not possible //Call without account is not possible
if (dynamic_cast<Account*>(call->account())) { if (dynamic_cast<Account*>(call->account())) {
if (call->account()->isAutoAnswer()) { if (call->account()->isAutoAnswer()) {
call->actionPerformed(Call::Action::ACCEPT); call->performAction(Call::Action::ACCEPT);
} }
} }
else { else {
...@@ -378,7 +378,7 @@ void CallModel::transfer(Call* toTransfer, QString target) ...@@ -378,7 +378,7 @@ void CallModel::transfer(Call* toTransfer, QString target)
qDebug() << "Transferring call " << toTransfer->id() << "to" << target; qDebug() << "Transferring call " << toTransfer->id() << "to" << target;
toTransfer->setTransferNumber ( target ); toTransfer->setTransferNumber ( target );
toTransfer->changeCurrentState( Call::State::TRANSFERRED ); toTransfer->changeCurrentState( Call::State::TRANSFERRED );
toTransfer->actionPerformed ( Call::Action::TRANSFER ); toTransfer->performAction ( Call::Action::TRANSFER );
toTransfer->changeCurrentState( Call::State::OVER ); toTransfer->changeCurrentState( Call::State::OVER );
} //transfer } //transfer
...@@ -761,7 +761,7 @@ bool CallModel::dropMimeData(const QMimeData* mimedata, Qt::DropAction action, i ...@@ -761,7 +761,7 @@ bool CallModel::dropMimeData(const QMimeData* mimedata, Qt::DropAction action, i
qDebug() << "Phone number" << encodedPhoneNumber << "on call" << target; qDebug() << "Phone number" << encodedPhoneNumber << "on call" << target;
Call* newCall = addDialingCall(QString(),target->account()); Call* newCall = addDialingCall(QString(),target->account());
newCall->setDialNumber(encodedPhoneNumber); newCall->setDialNumber(encodedPhoneNumber);
newCall->actionPerformed(Call::Action::ACCEPT); newCall->performAction(Call::Action::ACCEPT);
createConferenceFromCall(newCall,target); createConferenceFromCall(newCall,target);
} }
else if (mimedata->hasFormat(MIME_CONTACT)) { else if (mimedata->hasFormat(MIME_CONTACT)) {
...@@ -773,7 +773,7 @@ bool CallModel::dropMimeData(const QMimeData* mimedata, Qt::DropAction action, i ...@@ -773,7 +773,7 @@ bool CallModel::dropMimeData(const QMimeData* mimedata, Qt::DropAction action, i
if (!number->uri().isEmpty()) { if (!number->uri().isEmpty()) {
Call* newCall = addDialingCall(); Call* newCall = addDialingCall();
newCall->setDialNumber(number); newCall->setDialNumber(number);
newCall->actionPerformed(Call::Action::ACCEPT); newCall->performAction(Call::Action::ACCEPT);
createConferenceFromCall(newCall,target); createConferenceFromCall(newCall,target);
} }
else { else {
...@@ -947,6 +947,11 @@ void CallModel::slotStoppedDecoding(const QString& callId, const QString& shmKey ...@@ -947,6 +947,11 @@ void CallModel::slotStoppedDecoding(const QString& callId, const QString& shmKey
///Update model if the data change ///Update model if the data change
void CallModel::slotCallChanged(Call* call) void CallModel::slotCallChanged(Call* call)
{ {
//Transfer is "local" state, it doesn't require the daemon, so it need to be
//handled "manually" instead of relying on the backend signals
if (call->state() == Call::State::TRANSFERRED) {
emit callStateChanged(call, Call::State::TRANSFERRED);
}
InternalStruct* callInt = m_sPrivateCallList_call[call]; InternalStruct* callInt = m_sPrivateCallList_call[call];
if (callInt) { if (callInt) {
const int idxOf = m_lInternalModel.indexOf(callInt); const int idxOf = m_lInternalModel.indexOf(callInt);
......
...@@ -60,10 +60,13 @@ QVariant NumberCompletionModel::data(const QModelIndex& index, int role ) const ...@@ -60,10 +60,13 @@ QVariant NumberCompletionModel::data(const QModelIndex& index, int role ) const
case Qt::ToolTipRole: case Qt::ToolTipRole:
return QString("<table><tr><td>%1</td></tr><tr><td>%2</td></tr></table>").arg(n->primaryName()).arg(n->type()); return QString("<table><tr><td>%1</td></tr><tr><td>%2</td></tr></table>").arg(n->primaryName()).arg(n->type());
break; break;
case Qt::DecorationRole: case Qt::DecorationRole: {
if (NumberCategoryModel::instance()->visitor()) if (NumberCategoryModel::instance()->visitor()) {
return NumberCategoryModel::instance()->nameToIndex(n->type()).data(Qt::DecorationRole); const QModelIndex idx2 = NumberCategoryModel::instance()->nameToIndex(n->type());
break; if (idx2.isValid())
return idx2.data(Qt::DecorationRole);
}
} break;
case NumberCompletionModel::Role::ALTERNATE_ACCOUNT: case NumberCompletionModel::Role::ALTERNATE_ACCOUNT:
if (needAcc) if (needAcc)
return n->account()->alias(); return n->account()->alias();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment