1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:08:13 +00:00

Clipboard: Add a key-value map alongside the clipboard storage

A clipping now consists of three things:

- The raw clip data
- A MIME type
- A key-value map (String, String) for anything you like
This commit is contained in:
Andreas Kling 2020-09-05 16:26:22 +02:00
parent 51146e3075
commit 2e6d59b7b2
7 changed files with 34 additions and 11 deletions

View file

@ -68,7 +68,7 @@ OwnPtr<Messages::ClipboardServer::SetClipboardDataResponse> ClientConnection::ha
did_misbehave("SetClipboardData: Bad shared buffer ID");
return nullptr;
}
Storage::the().set_data(*shared_buffer, message.data_size(), message.mime_type());
Storage::the().set_data(*shared_buffer, message.data_size(), message.mime_type(), message.metadata().entries());
return make<Messages::ClipboardServer::SetClipboardDataResponse>();
}
@ -92,7 +92,7 @@ OwnPtr<Messages::ClipboardServer::GetClipboardDataResponse> ClientConnection::ha
// After we respond to GetClipboardData, we have to wait for the client to ref the buffer on his side.
m_last_sent_buffer = move(shared_buffer);
}
return make<Messages::ClipboardServer::GetClipboardDataResponse>(shbuf_id, storage.data_size(), storage.mime_type());
return make<Messages::ClipboardServer::GetClipboardDataResponse>(shbuf_id, storage.data_size(), storage.mime_type(), storage.metadata());
}
void ClientConnection::notify_about_clipboard_change()