mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-06 16:19:40 +00:00
GSortingProxyModel: Sort case insensitively by default (#441)
This commit is contained in:
parent
b9223e4f04
commit
0faaa1e53a
Notes:
sideshowbarker
2024-07-19 12:44:06 +09:00
Author: https://github.com/ignas-sa 🔰
Commit: 0faaa1e53a
Pull-request: https://github.com/SerenityOS/serenity/pull/441
2 changed files with 9 additions and 1 deletions
|
@ -87,7 +87,11 @@ void GSortingProxyModel::resort()
|
|||
auto data2 = target().data(target().index(row2, m_key_column), GModel::Role::Sort);
|
||||
if (data1 == data2)
|
||||
return 0;
|
||||
bool is_less_than = data1 < data2;
|
||||
bool is_less_than;
|
||||
if (data1.is_string() && data2.is_string() && !m_sorting_case_sensitive)
|
||||
is_less_than = data1.as_string().to_lowercase() < data2.as_string().to_lowercase();
|
||||
else
|
||||
is_less_than = data1 < data2;
|
||||
return m_sort_order == GSortOrder::Ascending ? is_less_than : !is_less_than;
|
||||
});
|
||||
if (previously_selected_target_row != -1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue