summaryrefslogtreecommitdiff
path: root/Userland/Services/SpiceAgent
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-12-04 18:02:33 +0000
committerAndreas Kling <kling@serenityos.org>2022-12-06 08:54:33 +0100
commit6e19ab2bbce0b113b628e6f8e9b5c0640053933e (patch)
tree372d21b2f5dcff112f5d0089559c6af5798680d4 /Userland/Services/SpiceAgent
parentf74251606d74b504a1379ebb893fdb5529054ea5 (diff)
downloadserenity-6e19ab2bbce0b113b628e6f8e9b5c0640053933e.zip
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 :^)
Diffstat (limited to 'Userland/Services/SpiceAgent')
-rw-r--r--Userland/Services/SpiceAgent/ConnectionToClipboardServer.cpp14
-rw-r--r--Userland/Services/SpiceAgent/ConnectionToClipboardServer.h2
-rw-r--r--Userland/Services/SpiceAgent/SpiceAgent.cpp4
-rw-r--r--Userland/Services/SpiceAgent/SpiceAgent.h2
4 files changed, 11 insertions, 11 deletions
diff --git a/Userland/Services/SpiceAgent/ConnectionToClipboardServer.cpp b/Userland/Services/SpiceAgent/ConnectionToClipboardServer.cpp
index a0f4d73581..f9ade07533 100644
--- a/Userland/Services/SpiceAgent/ConnectionToClipboardServer.cpp
+++ b/Userland/Services/SpiceAgent/ConnectionToClipboardServer.cpp
@@ -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());
diff --git a/Userland/Services/SpiceAgent/ConnectionToClipboardServer.h b/Userland/Services/SpiceAgent/ConnectionToClipboardServer.h
index b10cc39b29..c0d38bd158 100644
--- a/Userland/Services/SpiceAgent/ConnectionToClipboardServer.h
+++ b/Userland/Services/SpiceAgent/ConnectionToClipboardServer.h
@@ -27,7 +27,7 @@ private:
: IPC::ConnectionToServer<ClipboardClientEndpoint, ClipboardServerEndpoint>(*this, move(socket))
{
}
- virtual void clipboard_data_changed(String const&) override
+ virtual void clipboard_data_changed(DeprecatedString const&) override
{
on_data_changed();
}
diff --git a/Userland/Services/SpiceAgent/SpiceAgent.cpp b/Userland/Services/SpiceAgent/SpiceAgent.cpp
index 2e39f330f8..c9bb4a1eeb 100644
--- a/Userland/Services/SpiceAgent/SpiceAgent.cpp
+++ b/Userland/Services/SpiceAgent/SpiceAgent.cpp
@@ -6,7 +6,7 @@
#include "SpiceAgent.h"
#include "ConnectionToClipboardServer.h"
-#include <AK/String.h>
+#include <AK/DeprecatedString.h>
#include <LibC/memory.h>
#include <LibC/unistd.h>
#include <LibGfx/BMPLoader.h>
@@ -41,7 +41,7 @@ SpiceAgent::SpiceAgent(int fd, ConnectionToClipboardServer& connection)
send_message(buffer);
}
-Optional<SpiceAgent::ClipboardType> SpiceAgent::mime_type_to_clipboard_type(String const& mime)
+Optional<SpiceAgent::ClipboardType> SpiceAgent::mime_type_to_clipboard_type(DeprecatedString const& mime)
{
if (mime == "text/plain")
return ClipboardType::Text;
diff --git a/Userland/Services/SpiceAgent/SpiceAgent.h b/Userland/Services/SpiceAgent/SpiceAgent.h
index 09eddda92b..a6e705f06f 100644
--- a/Userland/Services/SpiceAgent/SpiceAgent.h
+++ b/Userland/Services/SpiceAgent/SpiceAgent.h
@@ -124,5 +124,5 @@ private:
bool m_just_set_clip { false };
void read_n(void* dest, size_t n);
static Message* initialize_headers(u8* data, size_t additional_data_size, MessageType type);
- static Optional<ClipboardType> mime_type_to_clipboard_type(String const& mime);
+ static Optional<ClipboardType> mime_type_to_clipboard_type(DeprecatedString const& mime);
};