diff options
-rw-r--r-- | src/corelib/text/qcollator_posix.cpp | 9 | ||||
-rw-r--r-- | tests/auto/corelib/text/qcollator/tst_qcollator.cpp | 6 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/corelib/text/qcollator_posix.cpp b/src/corelib/text/qcollator_posix.cpp index 92148fa315..7f04847434 100644 --- a/src/corelib/text/qcollator_posix.cpp +++ b/src/corelib/text/qcollator_posix.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2020 Aleix Pol Gonzalez <aleixpol@kde.org> +** Copyright (C) 2021 The Qt Company Ltd. +** Copyright (C) 2013 Aleix Pol Gonzalez <aleixpol@kde.org> ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -49,8 +50,10 @@ QT_BEGIN_NAMESPACE void QCollatorPrivate::init() { if (!isC()) { - if (locale != QLocale()) - qWarning("Only C and default locale supported with the posix collation implementation"); + if (locale != QLocale::system().collation()) { + qWarning("Only the C and system collation locales are supported " + "with the POSIX collation implementation"); + } if (caseSensitivity != Qt::CaseSensitive) qWarning("Case insensitive sorting unsupported in the posix collation implementation"); } diff --git a/tests/auto/corelib/text/qcollator/tst_qcollator.cpp b/tests/auto/corelib/text/qcollator/tst_qcollator.cpp index 1ff80294fe..6736bd936d 100644 --- a/tests/auto/corelib/text/qcollator/tst_qcollator.cpp +++ b/tests/auto/corelib/text/qcollator/tst_qcollator.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -282,8 +282,8 @@ void tst_QCollator::compare() }; #if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) - if (collator.locale() != QLocale()) - QSKIP("Posix implementation of collation only supports default locale"); + if (collator.locale() != QLocale::c() && collator.locale() != QLocale::system().collation()) + QSKIP("POSIX implementation of collation only supports C and system collation locales"); #endif if (numericMode) |