mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +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
Notes:
sideshowbarker
2024-07-19 09:04:50 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/2ad405c7898
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
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue