summaryrefslogtreecommitdiff
path: root/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp
diff options
context:
space:
mode:
authorTim Ledbetter <timledbetter@gmail.com>2023-01-14 14:52:16 +0000
committerJelle Raaijmakers <jelle@gmta.nl>2023-01-15 19:19:06 +0100
commit68fa8525bfd5fd43bcc15d3ad5179412e4b4af98 (patch)
tree74a619cd9a217c8eb42c3ca25c2423c138aaa55c /Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp
parent944c43a8b435fc16b3ba6d5dbb6a20b1c7923463 (diff)
downloadserenity-68fa8525bfd5fd43bcc15d3ad5179412e4b4af98.zip
ClipboardHistory: Add a Clear history action
This clears the history from the table view and clears the clipboard.
Diffstat (limited to 'Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp')
-rw-r--r--Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp b/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp
index 93d3606298..ecb6f5453c 100644
--- a/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp
+++ b/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp
@@ -136,6 +136,12 @@ void ClipboardHistoryModel::remove_item(int index)
invalidate();
}
+void ClipboardHistoryModel::clear()
+{
+ m_history_items.clear();
+ invalidate();
+}
+
void ClipboardHistoryModel::config_string_did_change(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, DeprecatedString const& value_string)
{
if (domain != "ClipboardHistory" || group != "ClipboardHistory")