diff options
author | Andreas Kling <kling@serenityos.org> | 2020-08-16 16:14:39 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-16 16:44:09 +0200 |
commit | 9102b624ac6b83d4e4418fecefd491f67d4603f8 (patch) | |
tree | 31b52c008e1b69fa1465913451270d45868dc853 /Libraries/LibGUI/SortingProxyModel.cpp | |
parent | 96f98b1fc92fec77d222c5b7b356b278c660429b (diff) | |
download | serenity-9102b624ac6b83d4e4418fecefd491f67d4603f8.zip |
LibGUI+DevTools+Applications: Use ModelIndex::data() in many places
This way you don't have to keep track of which model it came from.
Diffstat (limited to 'Libraries/LibGUI/SortingProxyModel.cpp')
-rw-r--r-- | Libraries/LibGUI/SortingProxyModel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibGUI/SortingProxyModel.cpp b/Libraries/LibGUI/SortingProxyModel.cpp index 440dd338e8..1eccc363bd 100644 --- a/Libraries/LibGUI/SortingProxyModel.cpp +++ b/Libraries/LibGUI/SortingProxyModel.cpp @@ -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; |