mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-13 06:32:54 +00:00
GModel: Remove selected_index() and set_selected_index()
This breaks GSortingProxyModel selection preservation across resorts. I'm not yet sure how we're going to solve that, but it's going to have to work a bit differently than before, since the model itself no longer knows what's selected. Selection is now managed by GModelSelection which allows us to select any arbitrary number of items, and to have different selections in different views onto the same model. Pretty sweet. :^)
This commit is contained in:
parent
6dec328af7
commit
2f5b2685af
Notes:
sideshowbarker
2024-07-19 12:13:20 +09:00
Author: https://github.com/awesomekling
Commit: 2f5b2685af
3 changed files with 0 additions and 28 deletions
|
@ -34,18 +34,6 @@ void GModel::did_update()
|
|||
});
|
||||
}
|
||||
|
||||
void GModel::set_selected_index(const GModelIndex& index)
|
||||
{
|
||||
if (m_selected_index == index)
|
||||
return;
|
||||
m_selected_index = index;
|
||||
if (on_selection_changed)
|
||||
on_selection_changed(index);
|
||||
for_each_view([](auto& view) {
|
||||
view.did_update_selection();
|
||||
});
|
||||
}
|
||||
|
||||
GModelIndex GModel::create_index(int row, int column, const void* data) const
|
||||
{
|
||||
return GModelIndex(*this, row, column, const_cast<void*>(data));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue