Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ install:
before_build:
# setup env
- CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
- SET PATH=%PATH%;c:\qbt\qt5_64\bin;%CACHE_DIR%\jom;
- SET PATH=%PATH%;C:\Qt\5.15.2\msvc2019_64\bin;%CACHE_DIR%\jom
Comment thread
FranciscoPombal marked this conversation as resolved.
Outdated
# setup project
- COPY /Y "%CACHE_DIR%\conf.pri" "%REPO_DIR%"
# workarounds
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ jobs:
libboost-dev libboost-chrono-dev libboost-random-dev libboost-system-dev
# sudo apt install libqt5svg5-dev qtbase5-dev qttools5-dev # the Qt version in the standard repositories is too old...

# this will be installed under /opt/qt514. CMake will still find it automatically without additional hints
# to speed up the process, only the required components are installed rather than the full qt514-meta-full metapackage
- name: install Qt 5.14.2 from an external PPA
# this will be installed under /opt/qt515. CMake will still find it automatically without additional hints
# to speed up the process, only the required components are installed rather than the full qt515-meta-full metapackage
- name: install Qt 5.15.2 from an external PPA
run: |
sudo add-apt-repository ppa:beineri/opt-qt-5.14.2-focal
sudo apt install qt514base qt514svg qt514tools
sudo add-apt-repository ppa:beineri/opt-qt-5.15.2-focal
sudo apt install qt515base qt515svg qt515tools

- name: install libtorrent from source
run: |
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/MacroQbtCommonConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ macro(qbt_common_config)
)

target_compile_definitions(qbt_common_cfg INTERFACE
QT_DISABLE_DEPRECATED_BEFORE=0x050e00
QT_DISABLE_DEPRECATED_BEFORE=0x050f02
QT_NO_CAST_TO_ASCII
QT_NO_CAST_FROM_BYTEARRAY
QT_USE_QSTRINGBUILDER
Expand Down
42 changes: 21 additions & 21 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -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])
Expand Down Expand Up @@ -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"],
Expand Down
10 changes: 5 additions & 5 deletions m4/qbittorrent.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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])
])

Expand All @@ -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])]
Expand All @@ -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])
Expand Down
8 changes: 2 additions & 6 deletions src/app/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -565,7 +561,7 @@ void Application::processParams(const QStringList &params)

if (param.startsWith(QLatin1String("@addPaused=")))
{
torrentParams.addPaused = (param.midRef(11).toInt() != 0);
torrentParams.addPaused = (QStringView(param).mid(11).toInt() != 0);
continue;
}

Expand Down Expand Up @@ -595,7 +591,7 @@ void Application::processParams(const QStringList &params)

if (param.startsWith(QLatin1String("@skipDialog=")))
{
skipTorrentDialog = (param.midRef(12).toInt() != 0);
skipTorrentDialog = (QStringView(param).mid(12).toInt() != 0);
continue;
}

Expand Down
12 changes: 6 additions & 6 deletions src/base/bittorrent/peeraddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@

using namespace BitTorrent;

PeerAddress PeerAddress::parse(const QString &address)
PeerAddress PeerAddress::parse(const QStringView address)
{
QVector<QStringRef> ipPort;
QList<QStringView> ipPort;

if (address.startsWith('[') && address.contains("]:"))
if (address.startsWith(u'[') && address.contains(QLatin1String("]:")))
{ // IPv6
ipPort = address.splitRef("]:");
ipPort = address.split(QString::fromLatin1("]:"));
ipPort[0] = ipPort[0].mid(1); // chop '['
}
else if (address.contains(':'))
else if (address.contains(u':'))
{ // IPv4
ipPort = address.splitRef(':');
ipPort = address.split(u':');
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/base/bittorrent/peeraddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace BitTorrent
QHostAddress ip;
ushort port = 0;

static PeerAddress parse(const QString &address);
static PeerAddress parse(QStringView address);
QString toString() const;
};

Expand Down
2 changes: 1 addition & 1 deletion src/base/bittorrent/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ void Session::populateAdditionalTrackers()
m_additionalTrackerList.clear();

const QString trackers = additionalTrackers();
for (QStringRef tracker : asConst(trackers.splitRef('\n')))
for (QStringView tracker : asConst(QStringView(trackers).split(u'\n')))
{
tracker = tracker.trimmed();
if (!tracker.isEmpty())
Expand Down
6 changes: 3 additions & 3 deletions src/base/bittorrent/torrentimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1866,9 +1866,9 @@ void TorrentImpl::handleFileRenamedAlert(const lt::file_renamed_alert *p)
if (m_oldPath[p->index].isEmpty())
m_oldPath.remove(p->index);

QVector<QStringRef> oldPathParts = oldFilePath.splitRef('/', Qt::SkipEmptyParts);
QList<QStringView> oldPathParts = QStringView(oldFilePath).split('/', Qt::SkipEmptyParts);
oldPathParts.removeLast(); // drop file name part
QVector<QStringRef> newPathParts = newFilePath.splitRef('/', Qt::SkipEmptyParts);
QList<QStringView> newPathParts = QStringView(newFilePath).split('/', Qt::SkipEmptyParts);
newPathParts.removeLast(); // drop file name part

#if defined(Q_OS_WIN)
Expand All @@ -1887,7 +1887,7 @@ void TorrentImpl::handleFileRenamedAlert(const lt::file_renamed_alert *p)

for (int i = (oldPathParts.size() - 1); i >= pathIdx; --i)
{
QDir().rmdir(savePath() + Utils::String::join(oldPathParts, QLatin1String("/")));
QDir().rmdir(savePath() + Utils::String::join(oldPathParts, QString::fromLatin1("/")));
oldPathParts.removeLast();
}

Expand Down
2 changes: 1 addition & 1 deletion src/base/bittorrent/torrentinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace
{
if (QDir::isAbsolutePath(filePath)) continue;

const auto filePathElements = filePath.splitRef('/');
const auto filePathElements = QStringView(filePath).split(u'/');
Comment thread
Chocobo1 marked this conversation as resolved.
Outdated
// if at least one file has no root folder, no common root folder exists
if (filePathElements.count() <= 1) return {};

Expand Down
12 changes: 6 additions & 6 deletions src/base/http/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ bool Connection::acceptsGzipEncoding(QString codings)
{
// [rfc7231] 5.3.4. Accept-Encoding

const auto isCodingAvailable = [](const QVector<QStringRef> &list, const QString &encoding) -> bool
const auto isCodingAvailable = [](const QList<QStringView> &list, const QStringView encoding) -> bool
{
for (const QStringRef &str : list)
for (const QStringView &str : list)
{
if (!str.startsWith(encoding))
continue;
Expand All @@ -149,7 +149,7 @@ bool Connection::acceptsGzipEncoding(QString codings)
return true;

// [rfc7231] 5.3.1. Quality Values
const QStringRef substr = str.mid(encoding.size() + 3); // ex. skip over "gzip;q="
const QStringView substr = str.mid(encoding.size() + 3); // ex. skip over "gzip;q="

bool ok = false;
const double qvalue = substr.toDouble(&ok);
Expand All @@ -161,15 +161,15 @@ bool Connection::acceptsGzipEncoding(QString codings)
return false;
};

const QVector<QStringRef> list = codings.remove(' ').remove('\t').splitRef(',', Qt::SkipEmptyParts);
const QList<QStringView> list = QStringView(codings.remove(' ').remove('\t')).split(u',', Qt::SkipEmptyParts);
if (list.isEmpty())
return false;

const bool canGzip = isCodingAvailable(list, QLatin1String("gzip"));
const bool canGzip = isCodingAvailable(list, QString::fromLatin1("gzip"));
if (canGzip)
return true;

const bool canAny = isCodingAvailable(list, QLatin1String("*"));
const bool canAny = isCodingAvailable(list, QString::fromLatin1("*"));
if (canAny)
return true;

Expand Down
Loading