Merge pull request #10338 from sledgehammer999/raise_qt5_ver

Raise minimum Qt version to 5.9.0
This commit is contained in:
sledgehammer999
2019-03-08 00:42:26 +02:00
committed by GitHub
11 changed files with 28 additions and 56 deletions

View File

@@ -149,10 +149,8 @@ Application::Application(const QString &id, int &argc, char **argv)
#if !defined(DISABLE_GUI)
setAttribute(Qt::AA_UseHighDpiPixmaps, true); // opt-in to the high DPI pixmap support
setQuitOnLastWindowClosed(false);
#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
setDesktopFileName("org.qbittorrent.qBittorrent");
#endif
#endif
#if defined(Q_OS_WIN) && !defined(DISABLE_GUI)
connect(this, &QGuiApplication::commitDataRequest, this, &Application::shutdownCleanup, Qt::DirectConnection);

View File

@@ -2179,16 +2179,7 @@ void Session::networkConfigurationChange(const QNetworkConfiguration &cfg)
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, 7, 1)
static QStringList boundIPs = getListeningIPs();
const QStringList newBoundIPs = getListeningIPs();
if ((configuredInterfaceName == changedInterface) && (boundIPs != newBoundIPs)) {
boundIPs = newBoundIPs;
#else
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);
configureListeningInterface();
}

View File

@@ -62,11 +62,7 @@ void ReverseResolution::resolve(const QString &ip)
}
else {
// Actually resolve the ip
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
m_lookups.insert(QHostInfo::lookupHost(ip, this, &ReverseResolution::hostResolved), ip);
#else
m_lookups.insert(QHostInfo::lookupHost(ip, this, SLOT(hostResolved(QHostInfo))), ip);
#endif
}
}

View File

@@ -74,12 +74,7 @@ SearchHandler::SearchHandler(const QString &pattern, const QString &category, co
m_searchProcess->setProgram(Utils::ForeignApps::pythonInfo().executableName);
m_searchProcess->setArguments(params + m_pattern.split(' '));
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
connect(m_searchProcess, &QProcess::errorOccurred, this, &SearchHandler::processFailed);
#else
connect(m_searchProcess, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error)
, this, &SearchHandler::processFailed);
#endif
connect(m_searchProcess, &QProcess::readyReadStandardOutput, this, &SearchHandler::readSearchOutput);
connect(m_searchProcess, static_cast<void (QProcess::*)(int)>(&QProcess::finished)
, this, &SearchHandler::processFinished);

View File

@@ -71,11 +71,7 @@ qreal Utils::Gui::screenScalingFactor(const QWidget *widget)
#elif defined(Q_OS_MAC)
return 1;
#else
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
return widget->devicePixelRatioF();
#else
return widget->devicePixelRatio();
#endif
#endif // Q_OS_WIN
}

View File

@@ -630,19 +630,7 @@ bool WebApplication::validateHostHeader(const QStringList &domains) const
}
// try matching host header with local address
#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
const bool sameAddr = m_env.localAddress.isEqual(QHostAddress(requestHost));
#else
const auto equal = [](const Q_IPV6ADDR &l, const Q_IPV6ADDR &r) -> bool
{
for (int i = 0; i < 16; ++i) {
if (l[i] != r[i])
return false;
}
return true;
};
const bool sameAddr = equal(m_env.localAddress.toIPv6Address(), QHostAddress(requestHost).toIPv6Address());
#endif
if (sameAddr)
return true;