1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 03:24:58 +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:
Andreas Kling 2020-02-24 20:54:27 +01:00
parent a5d7ea24e9
commit 2ad405c789

View file

@ -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);
}