Update QtZeroconf
This commit is contained in:
parent
ca682fc61f
commit
bfab7d7c87
@ -1 +1 @@
|
|||||||
Subproject commit 39efbe2879d93bd483ee1f14fc94281a03b49935
|
Subproject commit cbf4f2bf7b926b9a874af013efbf0f6dde3155e9
|
||||||
@ -260,14 +260,18 @@ void UpnpDiscovery::networkReplyFinished(QNetworkReply *reply)
|
|||||||
device->setName(name);
|
device->setName(name);
|
||||||
device->setVersion(version);
|
device->setVersion(version);
|
||||||
foreach (const QUrl &url, connections) {
|
foreach (const QUrl &url, connections) {
|
||||||
if (!device->connections()->find(url)) {
|
Connection *connection = device->connections()->find(url);
|
||||||
|
if (!connection) {
|
||||||
qDebug() << "UPnP: Adding new connection to host:" << device->name() << url;
|
qDebug() << "UPnP: Adding new connection to host:" << device->name() << url;
|
||||||
bool sslEnabled = url.scheme() == "nymeas" || url.scheme() == "wss";
|
bool sslEnabled = url.scheme() == "nymeas" || url.scheme() == "wss";
|
||||||
QString displayName = QString("%1:%2").arg(url.host()).arg(url.port());
|
QString displayName = QString("%1:%2").arg(url.host()).arg(url.port());
|
||||||
Connection::BearerType bearerType = QHostAddress(url.host()).isLoopback() ? Connection::BearerTypeLoopback : Connection::BearerTypeLan;
|
Connection::BearerType bearerType = QHostAddress(url.host()).isLoopback() ? Connection::BearerTypeLoopback : Connection::BearerTypeLan;
|
||||||
Connection *conn = new Connection(url, bearerType, sslEnabled, displayName);
|
connection = new Connection(url, bearerType, sslEnabled, displayName);
|
||||||
conn->setOnline(true);
|
connection->setOnline(true);
|
||||||
device->connections()->addConnection(conn);
|
device->connections()->addConnection(connection);
|
||||||
|
} else {
|
||||||
|
qDebug() << "UPnP: Setting connection online:" << device->name() << url.toString();
|
||||||
|
connection->setOnline(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -153,14 +153,14 @@ void ZeroconfDiscovery::serviceEntryAdded(const QZeroConfService &entry)
|
|||||||
url.setPort(entry->port());
|
url.setPort(entry->port());
|
||||||
Connection *connection = host->connections()->find(url);
|
Connection *connection = host->connections()->find(url);
|
||||||
if (!connection) {
|
if (!connection) {
|
||||||
// qDebug() << "Zeroconf: Adding new connection to host:" << host->name() << url.toString();
|
qDebug() << "Zeroconf: Adding new connection to host:" << host->name() << url.toString();
|
||||||
QString displayName = QString("%1:%2").arg(url.host()).arg(url.port());
|
QString displayName = QString("%1:%2").arg(url.host()).arg(url.port());
|
||||||
Connection::BearerType bearerType = QHostAddress(url.host()).isLoopback() ? Connection::BearerTypeLoopback : Connection::BearerTypeLan;
|
Connection::BearerType bearerType = QHostAddress(url.host()).isLoopback() ? Connection::BearerTypeLoopback : Connection::BearerTypeLan;
|
||||||
connection = new Connection(url, bearerType, sslEnabled, displayName);
|
connection = new Connection(url, bearerType, sslEnabled, displayName);
|
||||||
connection->setOnline(true);
|
connection->setOnline(true);
|
||||||
host->connections()->addConnection(connection);
|
host->connections()->addConnection(connection);
|
||||||
} else {
|
} else {
|
||||||
// qDebug() << "Zeroconf: Setting connection online:" << host->name() << url.toString();
|
qDebug() << "Zeroconf: Setting connection online:" << host->name() << url.toString();
|
||||||
connection->setOnline(true);
|
connection->setOnline(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -213,7 +213,7 @@ void ZeroconfDiscovery::serviceEntryRemoved(const QZeroConfService &entry)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// qDebug() << "Zeroconf: Setting connection offline:" << host->name() << url.toString();
|
qDebug() << "Zeroconf: Setting connection offline:" << host->name() << url.toString();
|
||||||
connection->setOnline(false);
|
connection->setOnline(false);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -375,7 +375,7 @@ Item {
|
|||||||
property var engine: mainRepeater.itemAt(index)._engine
|
property var engine: mainRepeater.itemAt(index)._engine
|
||||||
property string serverName: engine.nymeaConfiguration.serverName
|
property string serverName: engine.nymeaConfiguration.serverName
|
||||||
Material.elevation: index
|
Material.elevation: index
|
||||||
width: Math.max(150, tabbar.width / tabbar.count)
|
width: Math.max(150, tabbar.width / tabModel.count)
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
Reference in New Issue
Block a user