Fix changed signal when new hosts are discovered
parent
bef59fbdd7
commit
e42fe6f331
|
|
@ -137,7 +137,7 @@ void ZeroconfDiscovery::serviceEntryAdded(const QZeroConfService &entry)
|
|||
if (!host) {
|
||||
host = new NymeaHost(m_nymeaHosts);
|
||||
host->setUuid(uuid);
|
||||
// qDebug() << "ZeroConf: Adding new host:" << serverName << uuid;
|
||||
qDebug() << "ZeroConf: Adding new host:" << serverName << uuid;
|
||||
m_nymeaHosts->addHost(host);
|
||||
}
|
||||
host->setName(serverName);
|
||||
|
|
|
|||
|
|
@ -71,6 +71,14 @@ void NymeaHosts::addHost(NymeaHost *host)
|
|||
}
|
||||
}
|
||||
host->setParent(this);
|
||||
connect(host, &NymeaHost::nameChanged, this, [=](){
|
||||
int idx = m_hosts.indexOf(host);
|
||||
emit dataChanged(index(idx), index(idx), {NameRole});
|
||||
});
|
||||
connect(host, &NymeaHost::versionChanged, this, [=](){
|
||||
int idx = m_hosts.indexOf(host);
|
||||
emit dataChanged(index(idx), index(idx), {VersionRole});
|
||||
});
|
||||
connect(host, &NymeaHost::connectionChanged, this, &NymeaHosts::hostChanged);
|
||||
|
||||
beginInsertRows(QModelIndex(), m_hosts.count(), m_hosts.count());
|
||||
|
|
|
|||
Loading…
Reference in New Issue