mirror of
https://github.com/RGBCube/serenity
synced 2025-05-24 21:05:06 +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:
parent
a5d7ea24e9
commit
2ad405c789
1 changed files with 5 additions and 0 deletions
|
@ -81,6 +81,11 @@ Model::ColumnMetadata SortingProxyModel::column_metadata(int index) const
|
||||||
|
|
||||||
Variant SortingProxyModel::data(const ModelIndex& index, Role role) 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);
|
return target().data(map_to_target(index), role);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue