diff options
author | thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> | 2022-02-28 11:12:21 -0500 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-02 21:37:58 +0100 |
commit | f3d672d53dbec3d84254d56057594b5d6eff1e1c (patch) | |
tree | e8e9e5e2c36040e4fd5ca1ad9d52d636a2f1691b /Userland/Libraries | |
parent | 8825abe7ed397be21047bdcd7e241e7aac863272 (diff) | |
download | serenity-f3d672d53dbec3d84254d56057594b5d6eff1e1c.zip |
LibGUI: Support hierarchical matches in FilterProxyModel
Fixes crash when searching in Help.
Patch by @eggpi
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibGUI/FilteringProxyModel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGUI/FilteringProxyModel.cpp b/Userland/Libraries/LibGUI/FilteringProxyModel.cpp index 9143910c0f..51102ff0aa 100644 --- a/Userland/Libraries/LibGUI/FilteringProxyModel.cpp +++ b/Userland/Libraries/LibGUI/FilteringProxyModel.cpp @@ -41,8 +41,8 @@ Variant FilteringProxyModel::data(ModelIndex const& index, ModelRole role) const if ((size_t)index.row() > m_matching_indices.size() || index.row() < 0) return {}; - // FIXME: Support hierarchical models (with a non-empty index.parent()). - auto underlying_index = m_model->index(m_matching_indices[index.row()].row(), index.column(), {}); + auto matching_index = m_matching_indices[index.row()]; + auto underlying_index = m_model->index(matching_index.row(), index.column(), matching_index.parent()); return underlying_index.data(role); } |