From 0ff12f7c22e2be3238b0c436c08634cd18f5bd06 Mon Sep 17 00:00:00 2001 From: Raquel Medina Date: Mon, 9 Dec 2019 18:32:02 +0100 Subject: voice: remove vshl-capabilities dependencies Various fixes for voice component: - fix incorrect check on vap (voice agent profile) pointers; - remove dependencies on vshl-capabilities: this module will communicate via vshl-core api; - remove dependencis on alexa-voiceagent; - use a more generic name for cbl related operations. CBL in this environment is understood as code based login (for voice agent authorization via user login to a cloud service), however, in the case of alexa it is known as code based linking; - add check for voice_xxx_event eventdata which in ocasions is an empty object, i.e., the payload is missing. Bug-AGL: SPEC-2981 Signed-off-by: Raquel Medina Change-Id: Icaab7a21bedb3e2696d541567162ec46b047a305 --- voice/voiceagentregistry.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'voice/voiceagentregistry.cpp') diff --git a/voice/voiceagentregistry.cpp b/voice/voiceagentregistry.cpp index 22c7051..bbd9857 100644 --- a/voice/voiceagentregistry.cpp +++ b/voice/voiceagentregistry.cpp @@ -26,7 +26,7 @@ VoiceAgentRegistry::VoiceAgentRegistry(Voice *voice, QQmlContext *context, QObject *parent) : QObject(parent), m_model(nullptr), - m_voice(voice) + vc(voice) { m_model = new VoiceAgentModel(); QSortFilterProxyModel *model = new QSortFilterProxyModel(); @@ -102,7 +102,7 @@ void VoiceAgentRegistry::setAuthState(QString id, ServiceAuthState state) const auto stateStr = QMetaEnum::fromType().valueToKey(state); VoiceAgentProfile *vap = m_model->getAgentFromId(id); - if (!vap) + if (vap) vap->setAuthState(stateStr); } @@ -111,7 +111,7 @@ void VoiceAgentRegistry::setConnectionState(QString id, AgentConnectionState sta const auto stateStr = QMetaEnum::fromType().valueToKey(state); VoiceAgentProfile *vap = m_model->getAgentFromId(id); - if (!vap) + if (vap) vap->setConnState(stateStr); } @@ -120,15 +120,15 @@ void VoiceAgentRegistry::setDialogState(QString id, VoiceDialogState state) const auto stateStr = QMetaEnum::fromType().valueToKey(state); VoiceAgentProfile *vap = m_model->getAgentFromId(id); - if (!vap) + if (vap) vap->setDialogState(stateStr); } -void VoiceAgentRegistry::updateCblPair(QString id, QString code, QString url, - bool expired) +void VoiceAgentRegistry::updateLoginData(QString id, QString code, QString url, + bool expired) { VoiceAgentProfile *vap = m_model->getAgentFromId(id); - if (!vap) { + if (vap) { vap->setLoginCode(code); vap->setLoginUrl(code); vap->setLoginPairExpired(expired); -- cgit 1.2.3-korg