summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2022-02-28 11:12:21 -0500
committerAndreas Kling <kling@serenityos.org>2022-03-02 21:37:58 +0100
commitf3d672d53dbec3d84254d56057594b5d6eff1e1c (patch)
treee8e9e5e2c36040e4fd5ca1ad9d52d636a2f1691b /Userland/Libraries
parent8825abe7ed397be21047bdcd7e241e7aac863272 (diff)
downloadserenity-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.cpp4
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);
}