1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-02-03 02:14:16 +00:00

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 # version requirements - older versions may work, but you are on your own
set(minBoostVersion 1.71) set(minBoostVersion 1.71)
set(minQt6Version 6.2) set(minQt6Version 6.5.0)
set(minOpenSSLVersion 1.1.1) set(minOpenSSLVersion 1.1.1)
set(minLibtorrent1Version 1.2.19) set(minLibtorrent1Version 1.2.19)
set(minLibtorrentVersion 2.0.9) set(minLibtorrentVersion 2.0.9)

View File

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

View File

@ -29,8 +29,11 @@
#pragma once #pragma once
#include <type_traits> #include <type_traits>
#include <QtGlobal> #include <QtGlobal>
#include <QString>
#if (QT_POINTER_SIZE == 8) #if (QT_POINTER_SIZE == 8)
#define QBT_APP_64BIT #define QBT_APP_64BIT
#endif #endif
@ -46,14 +49,6 @@ constexpr typename std::add_const_t<T> asConst(T &&t) noexcept { return std::for
template <typename T> template <typename T>
void asConst(const T &&) = delete; 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; using namespace Qt::Literals::StringLiterals;
#endif
inline const QString TORRENT_FILE_EXTENSION = u".torrent"_s; 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) if (initResult != Z_OK)
return {}; return {};
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
QByteArray ret {static_cast<qsizetype>(deflateBound(&strm, data.size())), Qt::Uninitialized}; 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.next_out = reinterpret_cast<Bytef *>(ret.data());
strm.avail_out = ret.size(); 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}); return nonstd::make_unexpected(ReadError {ReadError::ExceedSize, message});
} }
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
QByteArray ret {fileSize, Qt::Uninitialized}; QByteArray ret {fileSize, Qt::Uninitialized};
#else
QByteArray ret {static_cast<int>(fileSize), Qt::Uninitialized};
#endif
const qint64 actualSize = file.read(ret.data(), fileSize); const qint64 actualSize = file.read(ret.data(), fileSize);
if (actualSize < 0) if (actualSize < 0)