mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-28 21:38:51 +03:00
Merge pull request #5135 from ngosang/ifces
Fix duplicate network interfaces. Closes #5131
This commit is contained in:
commit
ab412ebf37
1 changed files with 6 additions and 0 deletions
|
@ -257,6 +257,12 @@ void AdvancedSettings::loadAdvancedSettings()
|
||||||
bool interface_exists = current_iface.isEmpty();
|
bool interface_exists = current_iface.isEmpty();
|
||||||
int i = 1;
|
int i = 1;
|
||||||
foreach (const QNetworkInterface& iface, QNetworkInterface::allInterfaces()) {
|
foreach (const QNetworkInterface& iface, 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
|
||||||
|
// https://github.com/qbittorrent/qBittorrent/pull/5135
|
||||||
|
if (iface.addressEntries().isEmpty()) continue;
|
||||||
|
|
||||||
if (iface.flags() & QNetworkInterface::IsLoopBack) continue;
|
if (iface.flags() & QNetworkInterface::IsLoopBack) continue;
|
||||||
combo_iface.addItem(iface.humanReadableName(), iface.name());
|
combo_iface.addItem(iface.humanReadableName(), iface.name());
|
||||||
if (!current_iface.isEmpty() && (iface.name() == current_iface)) {
|
if (!current_iface.isEmpty() && (iface.name() == current_iface)) {
|
||||||
|
|
Loading…
Reference in a new issue