summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2023-05-14 23:04:47 +0200
committerAndreas Kling <kling@serenityos.org>2023-05-21 07:53:45 +0200
commit0ee5a4e3082ee0560c681e4e064e1f77448538f7 (patch)
tree79d17a826518496496065c3058a24cb549b97f70 /Userland/Services
parent67d9172885be49185d76f1a6a96ddb506f05f6b5 (diff)
downloadserenity-0ee5a4e3082ee0560c681e4e064e1f77448538f7.zip
Clipboard: Avoid unnecessary IPC::Dictionary wrapper
We already have and use HashMap<DeprecatedString, DeprecatedString> nearly everywhere, which is equivalent.
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/Clipboard/ClipboardServer.ipc4
-rw-r--r--Userland/Services/Clipboard/ConnectionFromClient.cpp4
-rw-r--r--Userland/Services/Clipboard/ConnectionFromClient.h2
-rw-r--r--Userland/Services/SpiceAgent/ConnectionToClipboardServer.cpp2
4 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Services/Clipboard/ClipboardServer.ipc b/Userland/Services/Clipboard/ClipboardServer.ipc
index 8145a9f7a6..3bacac59e1 100644
--- a/Userland/Services/Clipboard/ClipboardServer.ipc
+++ b/Userland/Services/Clipboard/ClipboardServer.ipc
@@ -2,6 +2,6 @@
endpoint ClipboardServer
{
- get_clipboard_data() => (Core::AnonymousBuffer data, [UTF8] DeprecatedString mime_type, IPC::Dictionary metadata)
- set_clipboard_data(Core::AnonymousBuffer data, [UTF8] DeprecatedString mime_type, IPC::Dictionary metadata) =|
+ get_clipboard_data() => (Core::AnonymousBuffer data, [UTF8] DeprecatedString mime_type, HashMap<DeprecatedString,DeprecatedString> metadata)
+ set_clipboard_data(Core::AnonymousBuffer data, [UTF8] DeprecatedString mime_type, HashMap<DeprecatedString,DeprecatedString> metadata) =|
}
diff --git a/Userland/Services/Clipboard/ConnectionFromClient.cpp b/Userland/Services/Clipboard/ConnectionFromClient.cpp
index a58892e447..e42f14276e 100644
--- a/Userland/Services/Clipboard/ConnectionFromClient.cpp
+++ b/Userland/Services/Clipboard/ConnectionFromClient.cpp
@@ -30,9 +30,9 @@ void ConnectionFromClient::die()
s_connections.remove(client_id());
}
-void ConnectionFromClient::set_clipboard_data(Core::AnonymousBuffer const& data, DeprecatedString const& mime_type, IPC::Dictionary const& metadata)
+void ConnectionFromClient::set_clipboard_data(Core::AnonymousBuffer const& data, DeprecatedString const& mime_type, HashMap<DeprecatedString, DeprecatedString> const& metadata)
{
- Storage::the().set_data(data, mime_type, metadata.entries());
+ Storage::the().set_data(data, mime_type, metadata);
}
Messages::ClipboardServer::GetClipboardDataResponse ConnectionFromClient::get_clipboard_data()
diff --git a/Userland/Services/Clipboard/ConnectionFromClient.h b/Userland/Services/Clipboard/ConnectionFromClient.h
index a04d62efaa..68ffa747df 100644
--- a/Userland/Services/Clipboard/ConnectionFromClient.h
+++ b/Userland/Services/Clipboard/ConnectionFromClient.h
@@ -30,7 +30,7 @@ private:
explicit ConnectionFromClient(NonnullOwnPtr<Core::LocalSocket>, int client_id);
virtual Messages::ClipboardServer::GetClipboardDataResponse get_clipboard_data() override;
- virtual void set_clipboard_data(Core::AnonymousBuffer const&, DeprecatedString const&, IPC::Dictionary const&) override;
+ virtual void set_clipboard_data(Core::AnonymousBuffer const&, DeprecatedString const&, HashMap<DeprecatedString, DeprecatedString> const&) override;
};
}
diff --git a/Userland/Services/SpiceAgent/ConnectionToClipboardServer.cpp b/Userland/Services/SpiceAgent/ConnectionToClipboardServer.cpp
index ef945af77e..0d7c316b39 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<DeprecatedString, DeprecatedString> const& metadata = clipping.metadata().entries();
+ HashMap<DeprecatedString, DeprecatedString> const& metadata = clipping.metadata();
auto width = metadata.get("width").value_or("0").to_uint();
if (!width.has_value() || width.value() == 0)
return nullptr;