mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 16:16:43 +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
Notes:
sideshowbarker
2024-07-17 06:54:15 +09:00
Author: https://github.com/LucasChollet
Commit: 07c6cebbab
Pull-request: https://github.com/SerenityOS/serenity/pull/17775
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/gmta
Reviewed-by: https://github.com/linusg
Reviewed-by: https://github.com/tcl3
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