Skip to content

Commit

Permalink
Use registered hosts instead of discovered hosts for mac
Browse files Browse the repository at this point in the history
  • Loading branch information
streetpea committed Sep 7, 2024
1 parent dd6bb01 commit c30f19c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions gui/src/qmlbackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -767,13 +767,11 @@ void QmlBackend::setConsolePin(int index, QString console_pin)
void QmlBackend::addManualHost(int index, const QString &address)
{
HostMAC hmac;
if (index >= 0) {
auto server = displayServerAt(index);
if (!server.valid)
return;
hmac = server.registered_host.GetServerMAC();
}
ManualHost host(-1, address, index >= 0, hmac);
QList<RegisteredHost> registered_hosts = settings->GetRegisteredHosts();
bool registered = (index >= 0 && (index < registered_hosts.length()));
if (registered)
hmac = registered_hosts.at(index).GetServerMAC();
ManualHost host(-1, address, registered, hmac);
settings->SetManualHost(host);
}

Expand Down

0 comments on commit c30f19c

Please sign in to comment.