Sort using mac address because at the time of sorting socket names are not known yet.
This commit is contained in:
förälder
4acb55c2e6
incheckning
4e89c2a6c7
|
@ -157,7 +157,7 @@ void Server::readPendingDatagrams()
|
|||
if (!duplicate) {
|
||||
Socket *socket = new Socket(sender, reply);
|
||||
sockets->push_back(socket);
|
||||
std::sort(sockets->begin(), sockets->end(), [](const Socket* a, const Socket* b) -> bool { return QString(a->socketName) < QString(b->socketName); });
|
||||
std::sort(sockets->begin(), sockets->end(), [](const Socket* a, const Socket* b) -> bool { return QString::compare(QString(a->mac), QString(b->mac)) < 0 ? true : false; }); // socket name is not known yet
|
||||
Q_EMIT discovered();
|
||||
}
|
||||
mac = reply.mid(7, 6);
|
||||
|
|
Laddar…
Referens i nytt ärende