HackStudio: Store correct address in ClassViewModel's ModelIndices
When 359d6e7b0b
happened, the return value
of `children[row]` went from being `ClassViewNode&` to
`NonnullOwnPtr<ClassViewNode>&`, so we were putting the wrong address
into the ModelIndex's data.
This commit is contained in:
parent
1393ed2000
commit
24d5bf8173
Notes:
sideshowbarker
2024-07-16 23:10:13 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/24d5bf8173 Pull-request: https://github.com/SerenityOS/serenity/pull/17773 Issue: https://github.com/SerenityOS/serenity/issues/17755 Reviewed-by: https://github.com/nico ✅
1 changed files with 2 additions and 2 deletions
|
@ -91,9 +91,9 @@ GUI::ModelIndex ClassViewModel::parent_index(const GUI::ModelIndex& index) const
|
|||
GUI::ModelIndex ClassViewModel::index(int row, int column, const GUI::ModelIndex& parent_index) const
|
||||
{
|
||||
if (!parent_index.is_valid())
|
||||
return create_index(row, column, &m_root_scope[row]);
|
||||
return create_index(row, column, m_root_scope[row].ptr());
|
||||
auto* parent = static_cast<ClassViewNode const*>(parent_index.internal_data());
|
||||
auto* child = &parent->children[row];
|
||||
auto* child = parent->children[row].ptr();
|
||||
return create_index(row, column, child);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue