diff options
author | Andreas Kling <kling@serenityos.org> | 2020-09-05 16:16:01 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-05 16:16:01 +0200 |
commit | 51146e30750141f5e604ef2df3ba4a721c0d7149 (patch) | |
tree | b48fcce9ff067ab5ce04a4b9cfdbf4a77a54c9f4 /Userland/paste.cpp | |
parent | 802f5411842db8c60373f89ce524b350c74bb6c5 (diff) | |
download | serenity-51146e30750141f5e604ef2df3ba4a721c0d7149.zip |
LibGUI: Make the Clipboard API deal in raw byte buffers a bit more
To open up for putting not just text/plain content on the clipboard,
let's make the GUI::Clipboard API a bit more raw-data-friendly. :^)
Diffstat (limited to 'Userland/paste.cpp')
-rw-r--r-- | Userland/paste.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/paste.cpp b/Userland/paste.cpp index 2a15dc00cd..57486ae383 100644 --- a/Userland/paste.cpp +++ b/Userland/paste.cpp @@ -46,19 +46,19 @@ int main(int argc, char* argv[]) auto& clipboard = GUI::Clipboard::the(); auto data_and_type = clipboard.data_and_type(); - if (data_and_type.type.is_null()) { + if (data_and_type.mime_type.is_null()) { fprintf(stderr, "Nothing copied\n"); return 1; } if (!print_type) { - printf("%s", data_and_type.data.characters()); + printf("%s", data_and_type.data.data()); // Append a newline to text contents, but // only if we're not asked not to do this. - if (data_and_type.type.starts_with("text/") && !no_newline) + if (data_and_type.mime_type.starts_with("text/") && !no_newline) putchar('\n'); } else { - printf("%s\n", data_and_type.type.characters()); + printf("%s\n", data_and_type.mime_type.characters()); } return 0; |