1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:37:46 +00:00

ClipboardHistory: Ensure model is populated on startup

This ensures that, if the applet restarts, it will remain in sync with
the clipboard.
This commit is contained in:
Tim Ledbetter 2023-01-14 15:08:41 +00:00 committed by Jelle Raaijmakers
parent 174135f909
commit 944c43a8b4
2 changed files with 6 additions and 1 deletions

View file

@ -36,6 +36,7 @@ public:
virtual ~ClipboardHistoryModel() override = default;
ClipboardItem const& item_at(int index) const { return m_history_items[index]; }
void add_item(const GUI::Clipboard::DataAndType& item);
void remove_item(int index);
bool is_empty() { return m_history_items.is_empty(); }
@ -47,7 +48,6 @@ public:
private:
ClipboardHistoryModel();
void add_item(const GUI::Clipboard::DataAndType& item);
// ^GUI::Model
virtual int row_count(const GUI::ModelIndex&) const override { return m_history_items.size(); }