diff --git a/src/comm/BluetoothLink.cc b/src/comm/BluetoothLink.cc index e6606987fe7c0037c9a2abeb8aa57d5ff6efd831..7819f84b944cf3ad9d80a70e26f8def93e0a0a64 100644 --- a/src/comm/BluetoothLink.cc +++ b/src/comm/BluetoothLink.cc @@ -340,7 +340,7 @@ void BluetoothConfiguration::deviceDiscovered(QBluetoothDeviceInfo info) qDebug() << "Address: " << info.address().toString(); qDebug() << "Service Classes:" << info.serviceClasses(); QList uuids = info.serviceUuids(); - foreach (QBluetoothUuid uuid, uuids) { + for (QBluetoothUuid uuid: uuids) { qDebug() << "Service UUID: " << uuid.toString(); } #endif @@ -373,7 +373,7 @@ void BluetoothConfiguration::doneScanning() void BluetoothConfiguration::setDevName(const QString &name) { - foreach(const BluetoothData& data, _deviceList) + for(const BluetoothData& data: _deviceList) { if(data.name == name) { diff --git a/src/comm/LinkManager.cc b/src/comm/LinkManager.cc index 0030c273c233004250d5fc89eb877087ffe62799..753c61532720abab5ceec57d29b88ed9312ffdc3 100644 --- a/src/comm/LinkManager.cc +++ b/src/comm/LinkManager.cc @@ -497,7 +497,7 @@ void LinkManager::_updateAutoConnectLinks(void) #endif // Iterate Comm Ports - foreach (QGCSerialPortInfo portInfo, portList) { + for (QGCSerialPortInfo portInfo: portList) { qCDebug(LinkManagerVerboseLog) << "-----------------------------------------------------"; qCDebug(LinkManagerVerboseLog) << "portName: " << portInfo.portName(); qCDebug(LinkManagerVerboseLog) << "systemLocation: " << portInfo.systemLocation(); @@ -638,7 +638,7 @@ void LinkManager::_updateAutoConnectLinks(void) } // Now remove all configs that are gone - foreach (LinkConfiguration* pDeleteConfig, _confToDelete) { + for (LinkConfiguration* pDeleteConfig: _confToDelete) { qCDebug(LinkManagerLog) << "Removing unused autoconnect config" << pDeleteConfig->name(); if (pDeleteConfig->link()) { disconnectLink(pDeleteConfig->link()); @@ -703,7 +703,7 @@ void LinkManager::_updateSerialPorts() _commPortDisplayList.clear(); #ifndef NO_SERIAL_LINK QList portList = QSerialPortInfo::availablePorts(); - foreach (const QSerialPortInfo &info, portList) + for (const QSerialPortInfo &info: portList) { QString port = info.systemLocation().trimmed(); _commPortList += port; diff --git a/src/comm/MAVLinkProtocol.cc b/src/comm/MAVLinkProtocol.cc index ffebfe6aa33a9ad1449c2f69b609019ad3427fc6..dff9c3c4bb41da9de0adcf17a290873e380b1cbf 100644 --- a/src/comm/MAVLinkProtocol.cc +++ b/src/comm/MAVLinkProtocol.cc @@ -453,7 +453,7 @@ void MAVLinkProtocol::checkForLostLogFiles(void) QFileInfoList fileInfoList = tempDir.entryInfoList(QStringList(filter), QDir::Files); //qDebug() << "Orphaned log file count" << fileInfoList.count(); - foreach(const QFileInfo fileInfo, fileInfoList) { + for(const QFileInfo fileInfo: fileInfoList) { //qDebug() << "Orphaned log file" << fileInfo.filePath(); if (fileInfo.size() == 0) { // Delete all zero length files @@ -476,7 +476,7 @@ void MAVLinkProtocol::deleteTempLogFiles(void) QString filter(QString("*.%1").arg(_logFileExtension)); QFileInfoList fileInfoList = tempDir.entryInfoList(QStringList(filter), QDir::Files); - foreach(const QFileInfo fileInfo, fileInfoList) { + for(const QFileInfo fileInfo: fileInfoList) { QFile::remove(fileInfo.filePath()); } } diff --git a/src/comm/QGCFlightGearLink.cc b/src/comm/QGCFlightGearLink.cc index 9bc551ef36046efae7080dc17a90aff6b4afbdc2..5300ad178f0732a5abddd818098b7cb5c6c8c9d0 100644 --- a/src/comm/QGCFlightGearLink.cc +++ b/src/comm/QGCFlightGearLink.cc @@ -956,7 +956,7 @@ void QGCFlightGearLink::_printFgfsOutput(void) QByteArray byteArray = _fgProcess->readAllStandardOutput(); QStringList strLines = QString(byteArray).split("\n"); - foreach (const QString &line, strLines){ + for (const QString &line: strLines){ qDebug() << line; } } @@ -968,7 +968,7 @@ void QGCFlightGearLink::_printFgfsError(void) QByteArray byteArray = _fgProcess->readAllStandardError(); QStringList strLines = QString(byteArray).split("\n"); - foreach (const QString &line, strLines){ + for (const QString &line: strLines){ qDebug() << line; } } diff --git a/src/comm/QGCSerialPortInfo.cc b/src/comm/QGCSerialPortInfo.cc index 883239e26b1a3ceb8f9d3171cf6b3861ce829812..56e299fe3ce8ede5567f9bf5de461f7e1ded2105 100644 --- a/src/comm/QGCSerialPortInfo.cc +++ b/src/comm/QGCSerialPortInfo.cc @@ -252,7 +252,7 @@ QList QGCSerialPortInfo::availablePorts(void) { QList list; - foreach(QSerialPortInfo portInfo, QSerialPortInfo::availablePorts()) { + for(QSerialPortInfo portInfo: QSerialPortInfo::availablePorts()) { if (!isSystemPort(&portInfo)) { list << *((QGCSerialPortInfo*)&portInfo); } diff --git a/src/comm/SerialLink.cc b/src/comm/SerialLink.cc index 015ec95c4e22539bcba0ab7f5db7844549f83634..dd0ce09db55cf71a5259d031b9543a1ecc0104ae 100644 --- a/src/comm/SerialLink.cc +++ b/src/comm/SerialLink.cc @@ -65,7 +65,7 @@ bool SerialLink::_isBootloader() if( portList.count() == 0){ return false; } - foreach (const QSerialPortInfo &info, portList) + for (const QSerialPortInfo &info: portList) { qCDebug(SerialLinkLog) << "PortName : " << info.portName() << "Description : " << info.description(); qCDebug(SerialLinkLog) << "Manufacturer: " << info.manufacturer(); diff --git a/src/comm/UDPLink.cc b/src/comm/UDPLink.cc index ff42b07f76a8b6580a4faa49b90cd535ea5805d8..606c72265453482ed7a1800a1d76da00dd2984c9 100644 --- a/src/comm/UDPLink.cc +++ b/src/comm/UDPLink.cc @@ -70,7 +70,7 @@ static QString get_ip_address(const QString& address) static bool contains_target(const QList list, const QHostAddress& address, quint16 port) { - foreach(UDPCLient* target, list) { + for(UDPCLient* target: list) { if(target->address == address && target->port == port) { return true; } @@ -91,7 +91,7 @@ UDPLink::UDPLink(SharedLinkConfigurationPointer& config) if (!_udpConfig) { qWarning() << "Internal error"; } - foreach (const QHostAddress &address, QNetworkInterface::allAddresses()) { + for (const QHostAddress &address: QNetworkInterface::allAddresses()) { _localAddress.append(QHostAddress(address)); } moveToThread(this); @@ -156,7 +156,7 @@ bool UDPLink::_isIpLocal(const QHostAddress& add) // On Windows, this is a very expensive call only Redmond would know // why. As such, we make it once and keep the list locally. If a new // interface shows up after we start, it won't be on this list. - foreach (const QHostAddress &address, _localAddress) { + for (const QHostAddress &address: _localAddress) { if (address == add) { // This is a local address of the same host return true; @@ -171,14 +171,14 @@ void UDPLink::_writeBytes(const QByteArray data) return; } // Send to all manually targeted systems - foreach(UDPCLient* target, _udpConfig->targetHosts()) { + for(UDPCLient* target: _udpConfig->targetHosts()) { // Skip it if it's part of the session clients below if(!contains_target(_sessionTargets, target->address, target->port)) { _writeDataGram(data, target); } } // Send to all connected systems - foreach(UDPCLient* target, _sessionTargets) { + for(UDPCLient* target: _sessionTargets) { _writeDataGram(data, target); } } @@ -401,7 +401,7 @@ void UDPConfiguration::_copyFrom(LinkConfiguration *source) if (usource) { _localPort = usource->localPort(); _clearTargetHosts(); - foreach(UDPCLient* target, usource->targetHosts()) { + for(UDPCLient* target: usource->targetHosts()) { if(!contains_target(_targetHosts, target->address, target->port)) { UDPCLient* newTarget = new UDPCLient(target); _targetHosts.append(newTarget);