mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-03 02:14:16 +00:00
parent
699dc1689a
commit
a0fa1709d5
@ -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
2
INSTALL
@ -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
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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…
x
Reference in New Issue
Block a user