mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 14:28:49 +00:00
LibGUI+DevTools+Applications: Use ModelIndex::data() in many places
This way you don't have to keep track of which model it came from.
This commit is contained in:
parent
96f98b1fc9
commit
9102b624ac
Notes:
sideshowbarker
2024-07-19 03:33:02 +09:00
Author: https://github.com/awesomekling
Commit: 9102b624ac
18 changed files with 56 additions and 57 deletions
|
@ -130,8 +130,8 @@ StringView SortingProxyModel::drag_data_type() const
|
|||
|
||||
bool SortingProxyModel::less_than(const ModelIndex& index1, const ModelIndex& index2) const
|
||||
{
|
||||
auto data1 = index1.model() ? index1.model()->data(index1, m_sort_role) : Variant();
|
||||
auto data2 = index2.model() ? index2.model()->data(index2, m_sort_role) : Variant();
|
||||
auto data1 = index1.data(m_sort_role);
|
||||
auto data2 = index2.data(m_sort_role);
|
||||
if (data1.is_string() && data2.is_string())
|
||||
return data1.as_string().to_lowercase() < data2.as_string().to_lowercase();
|
||||
return data1 < data2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue