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:
parent
c09d0c4816
commit
07c6cebbab
5 changed files with 143 additions and 7 deletions
|
@ -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>);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue