Show a verified icon for verified devices rather than a verify option

This commit is contained in:
James Graham
2024-04-06 14:19:38 +00:00
parent b30220eca9
commit 9b93eb44d5
2 changed files with 26 additions and 1 deletions

View File

@@ -19,6 +19,15 @@ using namespace Quotient;
DevicesModel::DevicesModel(QObject *parent)
: QAbstractListModel(parent)
{
connect(m_connection, &Connection::sessionVerified, this, [this](const QString &, const QString &deviceId) {
const auto it = std::find_if(m_devices.begin(), m_devices.end(), [deviceId](const Quotient::Device &device) {
return device.deviceId == deviceId;
});
if (it != m_devices.end()) {
const auto index = this->index(it - m_devices.begin());
Q_EMIT dataChanged(index, index, {Type});
}
});
}
void DevicesModel::fetchDevices()