mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-14 02:27:09 -07:00
Revise conditional for when to use QCollator
According to https://doc.qt.io/qt-6/qcollator.html#posix-fallback-implementation The 'POSIX fallback implementation' is only used when ICU is not available. So the correct way is to detect ICU directly and not depend on the OS. The exceptions are macOS and Windows since they support the required functionalities natively. Closes #20205. PR #20207.
This commit is contained in:
parent
fc56fdade7
commit
d5bf0358cb
2 changed files with 15 additions and 3 deletions
|
@ -199,11 +199,16 @@ add_library(qbt_base STATIC
|
|||
|
||||
target_link_libraries(qbt_base
|
||||
PRIVATE
|
||||
OpenSSL::Crypto OpenSSL::SSL
|
||||
OpenSSL::Crypto
|
||||
OpenSSL::SSL
|
||||
ZLIB::ZLIB
|
||||
PUBLIC
|
||||
LibtorrentRasterbar::torrent-rasterbar
|
||||
Qt::Core Qt::Network Qt::Sql Qt::Xml
|
||||
Qt::Core
|
||||
Qt::CorePrivate
|
||||
Qt::Network
|
||||
Qt::Sql
|
||||
Qt::Xml
|
||||
qbt_common_cfg
|
||||
)
|
||||
|
||||
|
|
|
@ -31,7 +31,14 @@
|
|||
#include <Qt>
|
||||
#include <QtSystemDetection>
|
||||
|
||||
#if !defined(Q_OS_WIN) && (!defined(Q_OS_UNIX) || defined(Q_OS_MACOS) || defined(QT_FEATURE_icu))
|
||||
// for QT_FEATURE_xxx, see: https://wiki.qt.io/Qt5_Build_System#How_to
|
||||
#include <QtCore/private/qtcore-config_p.h>
|
||||
|
||||
// macOS and Windows support 'case sensitivity' and 'numeric mode' natively
|
||||
// https://github.com/qt/qtbase/blob/6.0/src/corelib/CMakeLists.txt#L777-L793
|
||||
// https://github.com/qt/qtbase/blob/6.0/src/corelib/text/qcollator_macx.cpp#L74-L77
|
||||
// https://github.com/qt/qtbase/blob/6.0/src/corelib/text/qcollator_win.cpp#L72-L78
|
||||
#if ((QT_FEATURE_icu == 1) || defined(Q_OS_MACOS) || defined(Q_OS_WIN))
|
||||
#define QBT_USE_QCOLLATOR
|
||||
#include <QCollator>
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue