mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:27:35 +00:00
LibGUI: Move GUI::Model::Role to GUI::ModelRole
This is preparation for using ModelRole in the ModelIndex API.
This commit is contained in:
parent
f6d7204689
commit
a1e381a0f8
66 changed files with 201 additions and 167 deletions
|
@ -47,8 +47,10 @@ String ClipboardHistoryModel::column_name(int column) const
|
|||
}
|
||||
}
|
||||
|
||||
GUI::Variant ClipboardHistoryModel::data(const GUI::ModelIndex& index, Role) const
|
||||
GUI::Variant ClipboardHistoryModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) const
|
||||
{
|
||||
if (role != GUI::ModelRole::Display)
|
||||
return {};
|
||||
auto& data_and_type = m_history_items[index.row()];
|
||||
switch (index.column()) {
|
||||
case Column::Data:
|
||||
|
|
|
@ -49,7 +49,7 @@ private:
|
|||
virtual int row_count(const GUI::ModelIndex&) const override { return m_history_items.size(); }
|
||||
virtual String column_name(int) const override;
|
||||
virtual int column_count(const GUI::ModelIndex&) const override { return Column::__Count; }
|
||||
virtual GUI::Variant data(const GUI::ModelIndex&, Role = Role::Display) const override;
|
||||
virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override;
|
||||
virtual void update() override;
|
||||
|
||||
Vector<GUI::Clipboard::DataAndType> m_history_items;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue