Browse Source

Merge pull request #10338 from sledgehammer999/raise_qt5_ver

Raise minimum Qt version to 5.9.0
adaptive-webui-19844
sledgehammer999 6 years ago committed by GitHub
parent
commit
c2d1af9853
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      .travis.yml
  2. 2
      CMakeLists.txt
  3. 2
      INSTALL
  4. 24
      configure
  5. 10
      m4/qbittorrent.m4
  6. 2
      src/app/application.cpp
  7. 9
      src/base/bittorrent/session.cpp
  8. 4
      src/base/net/reverseresolution.cpp
  9. 5
      src/base/search/searchhandler.cpp
  10. 4
      src/gui/utils.cpp
  11. 12
      src/webui/webapplication.cpp

10
.travis.yml

@ -52,14 +52,17 @@ addons: @@ -52,14 +52,17 @@ addons:
sources:
# sources list: https://github.com/travis-ci/apt-source-safelist/blob/master/ubuntu.json
- sourceline: 'ppa:qbittorrent-team/qbittorrent-stable'
- sourceline: 'ppa:beineri/opt-qt59-xenial'
packages:
# packages list: https://github.com/travis-ci/apt-package-safelist/blob/master/ubuntu-trusty
- [autoconf, automake, colormake]
- [libboost-dev, libboost-system-dev]
- libssl-dev
- libtorrent-rasterbar-dev
- [qtbase5-dev, qttools5-dev-tools, libqt5svg5-dev]
- [qt59base, qt59svg, qt59tools]
- zlib1g-dev
# required for Qt 5.9 from 'beineri' PPA
- libgl1-mesa-dev
homebrew:
update: true
packages:
@ -85,6 +88,11 @@ before_install: @@ -85,6 +88,11 @@ before_install:
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
# setup virtual display for after_success target
if [ "$gui" = "true" ]; then export "DISPLAY=:99.0" && /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16 ; fi ;
# Qt 5.9
PATH=/opt/qt59/bin:${PATH}
qmake_conf="$qmake_conf PKG_CONFIG_PATH=/opt/qt59/lib/pkgconfig:$PKG_CONFIG_PATH"
cmake_conf="$cmake_conf PKG_CONFIG_PATH=/opt/qt59/lib/pkgconfig:$PKG_CONFIG_PATH"
fi
- |
if [ "$TRAVIS_OS_NAME" = "osx" ]; then

2
CMakeLists.txt

@ -31,7 +31,7 @@ include(FeatureSummary) @@ -31,7 +31,7 @@ include(FeatureSummary)
# version requirements
set(requiredBoostVersion 1.35)
set(requiredQtVersion 5.5.1)
set(requiredQtVersion 5.9.0)
set(requiredOpensslVersion 1.0)
set(requiredLibtorrentVersion 1.1.10)

2
INSTALL

@ -11,7 +11,7 @@ qBittorrent - A BitTorrent client in C++ / Qt @@ -11,7 +11,7 @@ qBittorrent - A BitTorrent client in C++ / Qt
- OpenSSL >= 1.0
- Qt >= 5.5.1
- Qt >= 5.9.0
- zlib >= 1.2.5.2

24
configure vendored

@ -1431,7 +1431,7 @@ Some influential environment variables: @@ -1431,7 +1431,7 @@ Some influential environment variables:
directories to add to pkg-config's search path
PKG_CONFIG_LIBDIR
path overriding pkg-config's built-in search path
QT_QMAKE value of host_bins for Qt5Core >= 5.5.1, overriding pkg-config
QT_QMAKE value of host_bins for Qt5Core >= 5.9.0, overriding pkg-config
Qt5Svg_CFLAGS
C compiler flags for Qt5Svg, overriding pkg-config
Qt5Svg_LIBS linker flags for Qt5Svg, overriding pkg-config
@ -4498,8 +4498,8 @@ $as_echo "$enable_webui" >&6; } @@ -4498,8 +4498,8 @@ $as_echo "$enable_webui" >&6; }
esac
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.5.1\""; } >&5
($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.5.1") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.9.0\""; } >&5
($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.9.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
@ -4508,12 +4508,12 @@ if test -n "$QT_QMAKE"; then @@ -4508,12 +4508,12 @@ if test -n "$QT_QMAKE"; then
pkg_cv_QT_QMAKE="$QT_QMAKE"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.5.1\""; } >&5
($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.5.1") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.9.0\""; } >&5
($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.9.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_QT_QMAKE=`$PKG_CONFIG --variable="host_bins" "Qt5Core >= 5.5.1" 2>/dev/null`
pkg_cv_QT_QMAKE=`$PKG_CONFIG --variable="host_bins" "Qt5Core >= 5.9.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@ -4540,8 +4540,8 @@ fi @@ -4540,8 +4540,8 @@ fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt5 qmake >= 5.5.1" >&5
$as_echo_n "checking for Qt5 qmake >= 5.5.1... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt5 qmake >= 5.9.0" >&5
$as_echo_n "checking for Qt5 qmake >= 5.9.0... " >&6; }
if test "x$QT_QMAKE" != "x"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $QT_QMAKE" >&5
$as_echo "$QT_QMAKE" >&6; }
@ -4655,11 +4655,11 @@ case "x$enable_qt_dbus" in #( @@ -4655,11 +4655,11 @@ case "x$enable_qt_dbus" in #(
"xyes") :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt5DBus >= 5.5.1" >&5
$as_echo_n "checking for Qt5DBus >= 5.5.1... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt5DBus >= 5.9.0" >&5
$as_echo_n "checking for Qt5DBus >= 5.9.0... " >&6; }
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5DBus >= 5.5.1\""; } >&5
($PKG_CONFIG --exists --print-errors "Qt5DBus >= 5.5.1") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5DBus >= 5.9.0\""; } >&5
($PKG_CONFIG --exists --print-errors "Qt5DBus >= 5.9.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then

10
m4/qbittorrent.m4

@ -5,9 +5,9 @@ @@ -5,9 +5,9 @@
# Sets the QT_QMAKE variable to the path of Qt5 qmake if found.
# --------------------------------------
AC_DEFUN([FIND_QT5],
[PKG_CHECK_EXISTS([Qt5Core >= 5.5.1],
[PKG_CHECK_EXISTS([Qt5Core >= 5.9.0],
[PKG_CHECK_VAR(QT_QMAKE,
[Qt5Core >= 5.5.1],
[Qt5Core >= 5.9.0],
[host_bins])
])
@ -18,7 +18,7 @@ AS_IF([test -f "$QT_QMAKE/qmake"], @@ -18,7 +18,7 @@ AS_IF([test -f "$QT_QMAKE/qmake"],
[QT_QMAKE=""])
])
AC_MSG_CHECKING([for Qt5 qmake >= 5.5.1])
AC_MSG_CHECKING([for Qt5 qmake >= 5.9.0])
AS_IF([test "x$QT_QMAKE" != "x"],
[AC_MSG_RESULT([$QT_QMAKE])],
[AC_MSG_RESULT([not found])]
@ -29,8 +29,8 @@ AS_IF([test "x$QT_QMAKE" != "x"], @@ -29,8 +29,8 @@ AS_IF([test "x$QT_QMAKE" != "x"],
# Sets the HAVE_QTDBUS variable to true or false.
# --------------------------------------
AC_DEFUN([FIND_QTDBUS],
[AC_MSG_CHECKING([for Qt5DBus >= 5.5.1])
PKG_CHECK_EXISTS([Qt5DBus >= 5.5.1],
[AC_MSG_CHECKING([for Qt5DBus >= 5.9.0])
PKG_CHECK_EXISTS([Qt5DBus >= 5.9.0],
[AC_MSG_RESULT([found])
HAVE_QTDBUS=[true]],
[AC_MSG_RESULT([not found])

2
src/app/application.cpp

@ -149,10 +149,8 @@ Application::Application(const QString &id, int &argc, char **argv) @@ -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);

9
src/base/bittorrent/session.cpp

@ -2179,16 +2179,7 @@ void Session::networkConfigurationChange(const QNetworkConfiguration &cfg) @@ -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();
}

4
src/base/net/reverseresolution.cpp

@ -62,11 +62,7 @@ void ReverseResolution::resolve(const QString &ip) @@ -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
}
}

5
src/base/search/searchhandler.cpp

@ -74,12 +74,7 @@ SearchHandler::SearchHandler(const QString &pattern, const QString &category, co @@ -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);

4
src/gui/utils.cpp

@ -71,11 +71,7 @@ qreal Utils::Gui::screenScalingFactor(const QWidget *widget) @@ -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
}

12
src/webui/webapplication.cpp

@ -630,19 +630,7 @@ bool WebApplication::validateHostHeader(const QStringList &domains) const @@ -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;

Loading…
Cancel
Save