mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-08-26 13:42:37 +00:00
Merge pull request #5332 from evsh/fix-qt5-log-flood
Add a workaround for QTBUG-52633, qBt issue #5073
This commit is contained in:
commit
26e8072c84
@ -1935,7 +1935,17 @@ void Session::networkConfigurationChange(const QNetworkConfiguration& cfg)
|
|||||||
if (configuredInterfaceName.isEmpty()) return;
|
if (configuredInterfaceName.isEmpty()) return;
|
||||||
|
|
||||||
const QString changedInterface = cfg.name();
|
const QString changedInterface = cfg.name();
|
||||||
|
|
||||||
|
// workaround for QTBUG-52633: check interface IPs, react only if the IPs have changed
|
||||||
|
// seems to be present only with NetworkManager, hence Q_OS_LINUX
|
||||||
|
#if defined Q_OS_LINUX && QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) // && QT_VERSION <= QT_VERSION_CHECK(5, ?, ?)
|
||||||
|
static QStringList boundIPs = getListeningIPs();
|
||||||
|
const QStringList newBoundIPs = getListeningIPs();
|
||||||
|
if ((configuredInterfaceName == changedInterface) && (boundIPs != newBoundIPs)) {
|
||||||
|
boundIPs = newBoundIPs;
|
||||||
|
#else
|
||||||
if (configuredInterfaceName == changedInterface) {
|
if (configuredInterfaceName == changedInterface) {
|
||||||
|
#endif
|
||||||
Logger::instance()->addMessage(tr("Network configuration of %1 has changed, refreshing session binding", "e.g: Network configuration of tun0 has changed, refreshing session binding").arg(changedInterface), Log::INFO);
|
Logger::instance()->addMessage(tr("Network configuration of %1 has changed, refreshing session binding", "e.g: Network configuration of tun0 has changed, refreshing session binding").arg(changedInterface), Log::INFO);
|
||||||
configureListeningInterface();
|
configureListeningInterface();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user