QtNetwork: port away from Java-style iterators
They are going to be deprecated. Change-Id: Ib021aad108dc021df76ae21d1db6c8a1a734893d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
parent
eeffdef1d7
commit
0efc6a88b6
@ -229,13 +229,12 @@ QSctpSocket *QSctpServer::nextPendingDatagramConnection()
|
|||||||
{
|
{
|
||||||
Q_D(QSctpServer);
|
Q_D(QSctpServer);
|
||||||
|
|
||||||
QMutableListIterator<QTcpSocket *> i(d->pendingConnections);
|
for (auto it = d->pendingConnections.begin(), end = d->pendingConnections.end(); it != end; ++it) {
|
||||||
while (i.hasNext()) {
|
QSctpSocket *socket = qobject_cast<QSctpSocket *>(*it);
|
||||||
QSctpSocket *socket = qobject_cast<QSctpSocket *>(i.next());
|
|
||||||
Q_ASSERT(socket);
|
Q_ASSERT(socket);
|
||||||
|
|
||||||
if (socket->isInDatagramMode()) {
|
if (socket->isInDatagramMode()) {
|
||||||
i.remove();
|
d->pendingConnections.erase(it);
|
||||||
Q_ASSERT(d->socketEngine);
|
Q_ASSERT(d->socketEngine);
|
||||||
d->socketEngine->setReadNotificationEnabled(true);
|
d->socketEngine->setReadNotificationEnabled(true);
|
||||||
return socket;
|
return socket;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user