mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +00:00
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. :^)
This commit is contained in:
parent
802f541184
commit
51146e3075
12 changed files with 43 additions and 38 deletions
|
@ -54,11 +54,11 @@ GUI::Variant ClipboardHistoryModel::data(const GUI::ModelIndex& index, GUI::Mode
|
|||
auto& data_and_type = m_history_items[index.row()];
|
||||
switch (index.column()) {
|
||||
case Column::Data:
|
||||
if (data_and_type.type.starts_with("text/"))
|
||||
return data_and_type.data;
|
||||
if (data_and_type.mime_type.starts_with("text/"))
|
||||
return String::copy(data_and_type.data);
|
||||
return "<...>";
|
||||
case Column::Type:
|
||||
return data_and_type.type;
|
||||
return data_and_type.mime_type;
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue