Browse Source

Raise minimum supported Qt version to 6.5

PR #19394.
adaptive-webui-19844
Vladimir Golovnev 1 year ago committed by GitHub
parent
commit
a0fa1709d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CMakeLists.txt
  2. 2
      INSTALL
  3. 11
      src/base/global.h
  4. 4
      src/base/utils/gzip.cpp
  5. 4
      src/base/utils/io.cpp

2
CMakeLists.txt

@ -8,7 +8,7 @@ project(qBittorrent @@ -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)

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.1.1
- Qt 6.2.0 - 6.x
- Qt 6.5.0 - 6.x
- zlib >= 1.2.11

11
src/base/global.h

@ -29,8 +29,11 @@ @@ -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 @@ -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;

4
src/base/utils/gzip.cpp

@ -61,11 +61,7 @@ QByteArray Utils::Gzip::compress(const QByteArray &data, const int level, bool * @@ -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();

4
src/base/utils/io.cpp

@ -89,11 +89,7 @@ nonstd::expected<QByteArray, Utils::IO::ReadError> Utils::IO::readFile(const Pat @@ -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)

Loading…
Cancel
Save