mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 19:59:17 +00:00
LibGUI: Complain in SortingProxyModel::data() if map_to_target() fails
There is some sort of issue with using a SortingProxyModel together with ColumnsView. This is a workaround to allow FilePicker to use a MultiView for now, but this needs to be fixed separately somehow.
This commit is contained in:
@@ -81,6 +81,11 @@ Model::ColumnMetadata SortingProxyModel::column_metadata(int index) const
|
||||
|
||||
Variant SortingProxyModel::data(const ModelIndex& index, Role role) const
|
||||
{
|
||||
auto target_index = map_to_target(index);
|
||||
if (!target_index.is_valid()) {
|
||||
dbg() << "BUG! SortingProxyModel: Unable to convert " << index << " to target";
|
||||
return {};
|
||||
}
|
||||
return target().data(map_to_target(index), role);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user