diff options
author | Raquel Medina <raquel.medina@konsulko.com> | 2019-12-13 22:34:58 +0100 |
---|---|---|
committer | Raquel Medina <raquel.medina@konsulko.com> | 2019-12-13 22:49:37 +0100 |
commit | 21bba7d5db82a5261ec3a5db1971985b70d49b07 (patch) | |
tree | 1fbab2d1609bddad25212cc0a8f57b7908110183 /voice/voiceagentmodel.cpp | |
parent | 9f3896cb82c27e912bc37ae88254367911050512 (diff) |
fix parsing event payload in presence of '\n' chars,icefish_8.99.3icefish/8.99.38.99.3
and include signal emit for voice status and cbl
changes.
- fix parsing event payload in presence of whitespaces;
- fix parsing voice events payload in presence of
'\n' chars;
- add missing model updates when status or cbl data
changes;
- fix authorization status enum value typo;
Bug-AGL: SPEC-2981
Signed-off-by: Raquel Medina <raquel.medina@konsulko.com>
Change-Id: I718bdfea1221211ed4c62ce1b695eabe83ab9590
Diffstat (limited to 'voice/voiceagentmodel.cpp')
-rw-r--r-- | voice/voiceagentmodel.cpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/voice/voiceagentmodel.cpp b/voice/voiceagentmodel.cpp index e0f9bfb..3f4f50d 100644 --- a/voice/voiceagentmodel.cpp +++ b/voice/voiceagentmodel.cpp @@ -73,8 +73,8 @@ QVariantList VoiceAgentModel::readLoginParams(const QModelIndex &index) const return ret; const VoiceAgentProfile *vap = this->m_agents[index.row()]; - ret.append(vap->loginurl()); ret.append(vap->logincode()); + ret.append(vap->loginurl()); ret.append(vap->isloginpairexpired()? "expired" : "valid"); return ret; } @@ -163,6 +163,39 @@ void VoiceAgentModel::updateAgentProperties(QString name, QString id, QString ap vroles.push_back(WuwRole); } if (!vroles.isEmpty()) + emit dataChanged(indexOf(vap), indexOf(vap), vroles); +} + +void VoiceAgentModel::updateAgentState(QString id) +{ + QVector<int> vroles; + VoiceAgentProfile *vap = getAgentFromId(id); + + if (!vap) { + qWarning() << "Unknown agent"; + return; + } + + vroles.push_back(AuthStateRole); + vroles.push_back(ConnStateRole); + vroles.push_back(DialogStateRole); + + if (!vroles.isEmpty()) + emit dataChanged(indexOf(vap), indexOf(vap), vroles); +} + +void VoiceAgentModel::updateAgentLoginData(QString id) +{ + QVector<int> vroles; + VoiceAgentProfile *vap = getAgentFromId(id); + + if (!vap) { + qWarning() << "Unknown agent"; + return; + } + + vroles.push_back(LoginParamsRole); + if (!vroles.isEmpty()) emit dataChanged(indexOf(vap), indexOf(vap), vroles); } |