From 27baa55443bfd42805a1222d848a54527ba9f62a Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (glassez)" Date: Fri, 9 Jul 2021 07:39:56 +0300 Subject: [PATCH] Raise minimum Qt version to 5.15.2 --- CMakeLists.txt | 2 +- INSTALL | 2 +- configure | 42 +++++++++++++++---------------- configure.ac | 3 ++- m4/qbittorrent.m4 | 10 ++++---- src/app/application.cpp | 4 --- src/base/net/smtp.cpp | 5 ---- src/gui/properties/proptabbar.cpp | 5 ---- src/gui/torrentoptionsdialog.cpp | 5 ---- 9 files changed, 30 insertions(+), 48 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f390c33f4..aa9fdefcf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ project(qBittorrent set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON) # version requirements - older vesions may work, but you are on your own set(minBoostVersion 1.65) -set(minQtVersion 5.14) +set(minQtVersion 5.15.2) set(minOpenSSLVersion 1.1.1) set(minLibtorrentVersion 1.2.14) set(minZlibVersion 1.2.11) diff --git a/INSTALL b/INSTALL index 6c6b7a3c1..79639b390 100644 --- a/INSTALL +++ b/INSTALL @@ -11,7 +11,7 @@ qBittorrent - A BitTorrent client in C++ / Qt - OpenSSL >= 1.1.1 - - Qt >= 5.14 + - Qt >= 5.15.2 - zlib >= 1.2.11 diff --git a/configure b/configure index 2d4980fcd..91fa2a986 100755 --- a/configure +++ b/configure @@ -1450,7 +1450,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.14, overriding pkg-config + QT_QMAKE value of host_bins for Qt5Core >= 5.15.2, overriding pkg-config Qt5Svg_CFLAGS C compiler flags for Qt5Svg, overriding pkg-config Qt5Svg_LIBS linker flags for Qt5Svg, overriding pkg-config @@ -5456,8 +5456,8 @@ printf "%s\n" "$enable_webui" >&6; } esac if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.14\""; } >&5 - ($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.14") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.15.2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.15.2") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then @@ -5466,12 +5466,12 @@ if test -n "$QT_QMAKE"; then pkg_cv_QT_QMAKE="$QT_QMAKE" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.14\""; } >&5 - ($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.14") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.15.2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.15.2") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_QT_QMAKE=`$PKG_CONFIG --variable="host_bins" "Qt5Core >= 5.14" 2>/dev/null` + pkg_cv_QT_QMAKE=`$PKG_CONFIG --variable="host_bins" "Qt5Core >= 5.15.2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -5501,8 +5501,8 @@ fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Qt5 qmake >= 5.14" >&5 -printf %s "checking for Qt5 qmake >= 5.14... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Qt5 qmake >= 5.15.2" >&5 +printf %s "checking for Qt5 qmake >= 5.15.2... " >&6; } if test "x$QT_QMAKE" != "x" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $QT_QMAKE" >&5 @@ -5529,12 +5529,12 @@ if test -n "$Qt5Svg_CFLAGS"; then pkg_cv_Qt5Svg_CFLAGS="$Qt5Svg_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Svg >= 5.14\""; } >&5 - ($PKG_CONFIG --exists --print-errors "Qt5Svg >= 5.14") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Svg >= 5.15.2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt5Svg >= 5.15.2") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_Qt5Svg_CFLAGS=`$PKG_CONFIG --cflags "Qt5Svg >= 5.14" 2>/dev/null` + pkg_cv_Qt5Svg_CFLAGS=`$PKG_CONFIG --cflags "Qt5Svg >= 5.15.2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -5546,12 +5546,12 @@ if test -n "$Qt5Svg_LIBS"; then pkg_cv_Qt5Svg_LIBS="$Qt5Svg_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Svg >= 5.14\""; } >&5 - ($PKG_CONFIG --exists --print-errors "Qt5Svg >= 5.14") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Svg >= 5.15.2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt5Svg >= 5.15.2") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_Qt5Svg_LIBS=`$PKG_CONFIG --libs "Qt5Svg >= 5.14" 2>/dev/null` + pkg_cv_Qt5Svg_LIBS=`$PKG_CONFIG --libs "Qt5Svg >= 5.15.2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -5572,14 +5572,14 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - Qt5Svg_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "Qt5Svg >= 5.14" 2>&1` + Qt5Svg_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "Qt5Svg >= 5.15.2" 2>&1` else - Qt5Svg_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "Qt5Svg >= 5.14" 2>&1` + Qt5Svg_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "Qt5Svg >= 5.15.2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$Qt5Svg_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (Qt5Svg >= 5.14) were not met: + as_fn_error $? "Package requirements (Qt5Svg >= 5.15.2) were not met: $Qt5Svg_PKG_ERRORS @@ -5619,11 +5619,11 @@ case "x$enable_qt_dbus" in #( "xyes") : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Qt5DBus >= 5.14" >&5 -printf %s "checking for Qt5DBus >= 5.14... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Qt5DBus >= 5.15.2" >&5 +printf %s "checking for Qt5DBus >= 5.15.2... " >&6; } if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5DBus >= 5.14\""; } >&5 - ($PKG_CONFIG --exists --print-errors "Qt5DBus >= 5.14") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5DBus >= 5.15.2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt5DBus >= 5.15.2") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then diff --git a/configure.ac b/configure.ac index 8f2064243..5c63b1df0 100644 --- a/configure.ac +++ b/configure.ac @@ -1,3 +1,4 @@ + AC_INIT([qbittorrent], [v4.4.0alpha], [bugs.qbittorrent.org], [], [https://www.qbittorrent.org/]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) @@ -141,7 +142,7 @@ AS_IF([test "x$QT_QMAKE" = "x"], [AC_MSG_ERROR([Could not find qmake]) ]) AS_IF([test "x$enable_gui" = "xyes"], - [PKG_CHECK_MODULES(Qt5Svg, [Qt5Svg >= 5.14]) + [PKG_CHECK_MODULES(Qt5Svg, [Qt5Svg >= 5.15.2]) ]) AC_MSG_CHECKING([whether QtDBus should be enabled]) AS_CASE(["x$enable_qt_dbus"], diff --git a/m4/qbittorrent.m4 b/m4/qbittorrent.m4 index 56bdadaaa..e67f93544 100644 --- a/m4/qbittorrent.m4 +++ b/m4/qbittorrent.m4 @@ -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.14], +[PKG_CHECK_EXISTS([Qt5Core >= 5.15.2], [PKG_CHECK_VAR(QT_QMAKE, - [Qt5Core >= 5.14], + [Qt5Core >= 5.15.2], [host_bins]) ]) @@ -18,7 +18,7 @@ AS_IF([test -f "$QT_QMAKE/qmake"], [QT_QMAKE=""]) ]) -AC_MSG_CHECKING([for Qt5 qmake >= 5.14]) +AC_MSG_CHECKING([for Qt5 qmake >= 5.15.2]) 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"], # Sets the HAVE_QTDBUS variable to true or false. # -------------------------------------- AC_DEFUN([FIND_QTDBUS], - [AC_MSG_CHECKING([for Qt5DBus >= 5.14]) - PKG_CHECK_EXISTS([Qt5DBus >= 5.14], + [AC_MSG_CHECKING([for Qt5DBus >= 5.15.2]) + PKG_CHECK_EXISTS([Qt5DBus >= 5.15.2], [AC_MSG_RESULT([found]) HAVE_QTDBUS=[true]], [AC_MSG_RESULT([not found]) diff --git a/src/app/application.cpp b/src/app/application.cpp index d89a51719..1bd586755 100644 --- a/src/app/application.cpp +++ b/src/app/application.cpp @@ -435,16 +435,12 @@ void Application::runExternalProgram(const BitTorrent::Torrent *torrent) const // enable command injection via torrent name and other arguments // (especially when some automated download mechanism has been setup). // See: https://github.com/qbittorrent/qBittorrent/issues/10925 -#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) QStringList args = QProcess::splitCommand(program); if (args.isEmpty()) return; const QString command = args.takeFirst(); QProcess::startDetached(command, args); -#else - QProcess::startDetached(program); -#endif #endif } diff --git a/src/base/net/smtp.cpp b/src/base/net/smtp.cpp index df5f157f0..0c4ed4e69 100644 --- a/src/base/net/smtp.cpp +++ b/src/base/net/smtp.cpp @@ -122,12 +122,7 @@ Smtp::Smtp(QObject *parent) connect(m_socket, &QIODevice::readyRead, this, &Smtp::readyRead); connect(m_socket, &QAbstractSocket::disconnected, this, &QObject::deleteLater); -#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) connect(m_socket, &QAbstractSocket::errorOccurred, this, &Smtp::error); -#else - connect(m_socket, qOverload(&QAbstractSocket::error) - , this, &Smtp::error); -#endif // Test hmacMD5 function (http://www.faqs.org/rfcs/rfc2202.html) Q_ASSERT(hmacMD5("Jefe", "what do ya want for nothing?").toHex() diff --git a/src/gui/properties/proptabbar.cpp b/src/gui/properties/proptabbar.cpp index 1f6b53e42..de7079c96 100644 --- a/src/gui/properties/proptabbar.cpp +++ b/src/gui/properties/proptabbar.cpp @@ -100,13 +100,8 @@ PropTabBar::PropTabBar(QWidget *parent) addWidget(speedButton); m_btnGroup->addButton(speedButton, SpeedTab); // SIGNAL/SLOT -#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) connect(m_btnGroup, &QButtonGroup::idClicked , this, &PropTabBar::setCurrentIndex); -#else - connect(m_btnGroup, qOverload(&QButtonGroup::buttonClicked) - , this, &PropTabBar::setCurrentIndex); -#endif // Disable buttons focus for (QAbstractButton *btn : asConst(m_btnGroup->buttons())) btn->setFocusPolicy(Qt::NoFocus); diff --git a/src/gui/torrentoptionsdialog.cpp b/src/gui/torrentoptionsdialog.cpp index 71326f71c..49ac52cf7 100644 --- a/src/gui/torrentoptionsdialog.cpp +++ b/src/gui/torrentoptionsdialog.cpp @@ -263,12 +263,7 @@ TorrentOptionsDialog::TorrentOptionsDialog(QWidget *parent, const QVectorcheckMaxRatio, &QCheckBox::toggled, m_ui->spinRatioLimit, &QDoubleSpinBox::setEnabled); connect(m_ui->checkMaxTime, &QCheckBox::toggled, m_ui->spinTimeLimit, &QSpinBox::setEnabled); -#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) connect(m_ui->buttonGroup, &QButtonGroup::idClicked, this, &TorrentOptionsDialog::handleRatioTypeChanged); -#else - connect(m_ui->buttonGroup, qOverload(&QButtonGroup::buttonClicked) - , this, &TorrentOptionsDialog::handleRatioTypeChanged); -#endif Utils::Gui::resize(this, m_storeDialogSize); }