MCPcopy Create free account
hub / github.com/MeisApps/pcbu-desktop / DevicesTableModel

Method DevicesTableModel

desktop/src/ui/models/DevicesTableModel.cpp:5–13  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include "storage/PairedDevicesStorage.h"
4
5DevicesTableModel::DevicesTableModel(QObject *parent) : QAbstractTableModel(parent) {
6 for(const auto &device : PairedDevicesStorage::GetDevices()) {
7 auto pairingId = QString::fromUtf8(device.id);
8 auto deviceName = QString::fromUtf8(device.deviceName);
9 auto userName = QString::fromUtf8(device.userName);
10 auto method = QString::fromUtf8(PairingMethodUtils::ToString(device.pairingMethod));
11 m_TableData.append({pairingId, deviceName, userName, method});
12 }
13}
14
15Q_INVOKABLE QVector<QString> DevicesTableModel::get(int rowIdx) {
16 if(rowIdx >= m_TableData.at(0).size())

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected