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

Applets/ClipboardHistory: Add persistent storage

Clipboard entries are now preserved upon reboot :^). Unfortunately, it
only supports data with the mimetype "text/".

This is done by writing all entries as a JSON object in a file located
in ~/.data.

Co-authored-by: Sagittarius-a <sagittarius-a@users.noreply.github.com>
This commit is contained in:
Lucas CHOLLET 2023-03-08 16:13:42 -05:00 committed by Andrew Kaster
parent c09d0c4816
commit 07c6cebbab
5 changed files with 143 additions and 7 deletions

View file

@ -11,6 +11,7 @@
#include <AK/DeprecatedString.h>
#include <AK/Function.h>
#include <AK/HashMap.h>
#include <AK/JsonObject.h>
#include <LibGUI/Forward.h>
#include <LibGfx/Forward.h>
@ -34,6 +35,9 @@ public:
HashMap<DeprecatedString, DeprecatedString> metadata;
RefPtr<Gfx::Bitmap> as_bitmap() const;
static ErrorOr<Clipboard::DataAndType> from_json(JsonObject const& object);
ErrorOr<JsonObject> to_json() const;
};
static ErrorOr<void> initialize(Badge<Application>);