mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 01:23:24 -08:00
Some checks are pending
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (actions) (push) Waiting to run
Build Desktop / Configure (push) Waiting to run
Build Desktop / Debian 13 (push) Blocked by required conditions
Build Desktop / Debian 12 (push) Blocked by required conditions
Build Desktop / Fedora 44 (push) Blocked by required conditions
Build Desktop / Fedora 43 (push) Blocked by required conditions
Build Desktop / Servatrice_Debian 12 (push) Blocked by required conditions
Build Desktop / Ubuntu 24.04 (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 (push) Blocked by required conditions
Build Desktop / Arch (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 cover (push) Blocked by required conditions
Build Desktop / macOS 13 Intel (push) Blocked by required conditions
Build Desktop / macOS 14 (push) Blocked by required conditions
Build Desktop / macOS 15 (push) Blocked by required conditions
Build Desktop / macOS 26 Debug (push) Blocked by required conditions
Build Desktop / Windows 10 (push) Blocked by required conditions
Build Desktop / Prune caches (push) Waiting to run
Build Docker / Servatrice (arm) (push) Waiting to run
Build Docker / Servatrice (x86) (push) Waiting to run
Build Docker / Publish multi-platform Servatrice image (push) Blocked by required conditions
* [Models] Use QCollator for natural, cached sorting QString::localeAwareCompare rebuilds its collation data for every comparison, and it compares numbers as text. Keep one QCollator per model, enable numeric mode, and use it for the card name, set and user name sorts. Add a test that sorts "Forest 1", "Forest 2", "Forest 10" through DeckListSortFilterProxyModel and checks the natural order. * [Models] Sort naturally under the C locale too Numeric mode only takes effect through a real locale: under the C locale, which headless CI processes run in, QCollator silently falls back to string order and sorts "Forest 10" before "Forest 2". That made collator_sort_test fail on every Linux leg while passing locally. Add makeNaturalSortCollator(), which enables numeric mode and pins English only when the process locale is the degenerate one, and build the models' collators through it. Users with a real locale keep their own collation. * [Models] Fix compile of natural sorting (QStringView mismatch) * nit: initialize collators in member initializer lists * nit: namespace makeNaturalSortCollator under NaturalSort --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
35 lines
631 B
CMake
35 lines
631 B
CMake
cockatrice_add_test(
|
|
NAME
|
|
deck_list_model_custom_zones_test
|
|
SOURCES
|
|
${VERSION_STRING_CPP}
|
|
deck_list_model_custom_zones_test.cpp
|
|
LIBS
|
|
libcockatrice_models
|
|
libcockatrice_card
|
|
libcockatrice_deck_list
|
|
)
|
|
|
|
cockatrice_add_test(
|
|
NAME
|
|
deck_list_model_zone_integration_test
|
|
SOURCES
|
|
${VERSION_STRING_CPP}
|
|
deck_list_model_zone_integration_test.cpp
|
|
LIBS
|
|
libcockatrice_models
|
|
libcockatrice_card
|
|
libcockatrice_deck_list
|
|
)
|
|
|
|
cockatrice_add_test(
|
|
NAME
|
|
collator_sort_test
|
|
SOURCES
|
|
${VERSION_STRING_CPP}
|
|
collator_sort_test.cpp
|
|
LIBS
|
|
libcockatrice_models
|
|
libcockatrice_card
|
|
libcockatrice_deck_list
|
|
)
|