From 3a49485039fd40a42d84e831efdde613517ce2ec Mon Sep 17 00:00:00 2001 From: ngosang Date: Sun, 17 Apr 2016 20:55:01 +0200 Subject: [PATCH] Fix duplicate network interfaces. Closes #5131 --- src/gui/advancedsettings.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/advancedsettings.cpp b/src/gui/advancedsettings.cpp index 1216ed5c3..14075b892 100644 --- a/src/gui/advancedsettings.cpp +++ b/src/gui/advancedsettings.cpp @@ -257,6 +257,12 @@ void AdvancedSettings::loadAdvancedSettings() bool interface_exists = current_iface.isEmpty(); int i = 1; 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; combo_iface.addItem(iface.humanReadableName(), iface.name()); if (!current_iface.isEmpty() && (iface.name() == current_iface)) {