mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 06:28:03 -06:00
Combine qAsConst() with copyAsConst() to asConst()
This commit is contained in:
@@ -287,7 +287,7 @@ void AdvancedSettings::updateInterfaceAddressCombo()
|
||||
};
|
||||
|
||||
if (ifaceName.isEmpty()) {
|
||||
for (const QHostAddress &ip : copyAsConst(QNetworkInterface::allAddresses()))
|
||||
for (const QHostAddress &ip : asConst(QNetworkInterface::allAddresses()))
|
||||
populateCombo(ip.toString(), ip.protocol());
|
||||
}
|
||||
else {
|
||||
@@ -426,7 +426,7 @@ void AdvancedSettings::loadAdvancedSettings()
|
||||
const QString currentInterface = session->networkInterface();
|
||||
bool interfaceExists = currentInterface.isEmpty();
|
||||
int i = 1;
|
||||
for (const QNetworkInterface &iface : copyAsConst(QNetworkInterface::allInterfaces())) {
|
||||
for (const QNetworkInterface &iface : asConst(QNetworkInterface::allInterfaces())) {
|
||||
// This line fixes a Qt bug => https://bugreports.qt.io/browse/QTBUG-52633
|
||||
// Tested in Qt 5.6.0. For more info see:
|
||||
// https://github.com/qbittorrent/qBittorrent/issues/5131
|
||||
|
||||
Reference in New Issue
Block a user