mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 15:47:35 +00:00
AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
This commit is contained in:
parent
f74251606d
commit
6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions
|
@ -17,7 +17,7 @@ RefPtr<Gfx::Bitmap> ConnectionToClipboardServer::get_bitmap()
|
|||
if (clipping.mime_type() != "image/x-serenityos")
|
||||
return nullptr;
|
||||
|
||||
HashMap<String, String> const& metadata = clipping.metadata().entries();
|
||||
HashMap<DeprecatedString, DeprecatedString> const& metadata = clipping.metadata().entries();
|
||||
auto width = metadata.get("width").value_or("0").to_uint();
|
||||
if (!width.has_value() || width.value() == 0)
|
||||
return nullptr;
|
||||
|
@ -60,12 +60,12 @@ RefPtr<Gfx::Bitmap> ConnectionToClipboardServer::get_bitmap()
|
|||
// Copied from LibGUI/Clipboard.cpp
|
||||
void ConnectionToClipboardServer::set_bitmap(Gfx::Bitmap const& bitmap)
|
||||
{
|
||||
HashMap<String, String> metadata;
|
||||
metadata.set("width", String::number(bitmap.width()));
|
||||
metadata.set("height", String::number(bitmap.height()));
|
||||
metadata.set("scale", String::number(bitmap.scale()));
|
||||
metadata.set("format", String::number((int)bitmap.format()));
|
||||
metadata.set("pitch", String::number(bitmap.pitch()));
|
||||
HashMap<DeprecatedString, DeprecatedString> metadata;
|
||||
metadata.set("width", DeprecatedString::number(bitmap.width()));
|
||||
metadata.set("height", DeprecatedString::number(bitmap.height()));
|
||||
metadata.set("scale", DeprecatedString::number(bitmap.scale()));
|
||||
metadata.set("format", DeprecatedString::number((int)bitmap.format()));
|
||||
metadata.set("pitch", DeprecatedString::number(bitmap.pitch()));
|
||||
ReadonlyBytes data { bitmap.scanline(0), bitmap.size_in_bytes() };
|
||||
auto buffer_or_error = Core::AnonymousBuffer::create_with_size(bitmap.size_in_bytes());
|
||||
VERIFY(!buffer_or_error.is_error());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue