Raise minimum supported Qt version to 6.5

PR #19394.
This commit is contained in:
Vladimir Golovnev 2023-08-07 07:19:43 +03:00 committed by GitHub
parent 699dc1689a
commit a0fa1709d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 18 deletions

View file

@ -8,7 +8,7 @@ project(qBittorrent
# version requirements - older versions may work, but you are on your own
set(minBoostVersion 1.71)
set(minQt6Version 6.2)
set(minQt6Version 6.5.0)
set(minOpenSSLVersion 1.1.1)
set(minLibtorrent1Version 1.2.19)
set(minLibtorrentVersion 2.0.9)

View file

@ -11,7 +11,7 @@ qBittorrent - A BitTorrent client in C++ / Qt
- OpenSSL >= 1.1.1
- Qt 6.2.0 - 6.x
- Qt 6.5.0 - 6.x
- zlib >= 1.2.11

View file

@ -29,8 +29,11 @@
#pragma once
#include <type_traits>
#include <QtGlobal>
#include <QString>
#if (QT_POINTER_SIZE == 8)
#define QBT_APP_64BIT
#endif
@ -46,14 +49,6 @@ constexpr typename std::add_const_t<T> asConst(T &&t) noexcept { return std::for
template <typename T>
void asConst(const T &&) = delete;
#if (QT_VERSION < QT_VERSION_CHECK(6, 4, 0))
// https://doc.qt.io/qt-6/qstring.html#operator-22-22_s
inline QString operator"" _s(const char16_t *str, const std::size_t size)
{
return operator""_qs(str, size);
}
#else
using namespace Qt::Literals::StringLiterals;
#endif
inline const QString TORRENT_FILE_EXTENSION = u".torrent"_s;

View file

@ -61,11 +61,7 @@ QByteArray Utils::Gzip::compress(const QByteArray &data, const int level, bool *
if (initResult != Z_OK)
return {};
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
QByteArray ret {static_cast<qsizetype>(deflateBound(&strm, data.size())), Qt::Uninitialized};
#else
QByteArray ret {static_cast<int>(deflateBound(&strm, data.size())), Qt::Uninitialized};
#endif
strm.next_out = reinterpret_cast<Bytef *>(ret.data());
strm.avail_out = ret.size();

View file

@ -89,11 +89,7 @@ nonstd::expected<QByteArray, Utils::IO::ReadError> Utils::IO::readFile(const Pat
return nonstd::make_unexpected(ReadError {ReadError::ExceedSize, message});
}
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
QByteArray ret {fileSize, Qt::Uninitialized};
#else
QByteArray ret {static_cast<int>(fileSize), Qt::Uninitialized};
#endif
const qint64 actualSize = file.read(ret.data(), fileSize);
if (actualSize < 0)