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

ClipboardHistory: Store clipboard history as valid JSON

Previously, the ClipboardHistory.json file contained a series of
individual JSON objects for history items, separated by newlines. This
is convenient for appending a single item, but makes the file itself
invalid JSON.

This commit changes that file to instead contain those objects in a
proper JSON array.
This commit is contained in:
Sam Atkins 2024-02-07 12:33:26 +00:00 committed by Sam Atkins
parent ff3e454565
commit 0b9aee57e7
2 changed files with 26 additions and 39 deletions

View file

@ -45,9 +45,9 @@ public:
bool is_empty() { return m_history_items.is_empty(); }
ErrorOr<void> read_from_file(ByteString const& path);
ErrorOr<void> write_to_file(bool rewrite_all);
ErrorOr<void> write_to_file();
ErrorOr<void> invalidate_model_and_file(bool rewrite_all);
ErrorOr<void> invalidate_model_and_file();
// ^GUI::Model
virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override;