summaryrefslogtreecommitdiffstats
path: root/voice/voiceagentmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'voice/voiceagentmodel.cpp')
-rw-r--r--voice/voiceagentmodel.cpp35
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);
}