1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:57:46 +00:00

Userland: Convert config listener callbacks to use StringView

The immutability of the string is not relevant here, since the string
we're given was allocated in the IPC serialization layer and will be
destroyed shortly afterwards. Additionally, noone relies on
DeprecatedString-specific functionality. This will make it easier to
convert the IPC layer itself to String later on.
This commit is contained in:
kleines Filmröllchen 2023-06-26 21:05:53 +02:00 committed by Sam Atkins
parent 5f1dbbaaa6
commit 33829f05fe
22 changed files with 46 additions and 46 deletions

View file

@ -325,7 +325,7 @@ Direction Game::direction_to_position(Snake::Coordinate const& from, Snake::Coor
VERIFY_NOT_REACHED();
}
void Game::config_string_did_change(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, DeprecatedString const& value)
void Game::config_string_did_change(StringView domain, StringView group, StringView key, StringView value)
{
if (domain == "Snake"sv && group == "Snake"sv && key == "SnakeSkin"sv) {
set_skin_name(value);
@ -333,7 +333,7 @@ void Game::config_string_did_change(DeprecatedString const& domain, DeprecatedSt
}
}
void Game::config_u32_did_change(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, u32 value)
void Game::config_u32_did_change(StringView domain, StringView group, StringView key, u32 value)
{
if (domain == "Snake"sv && group == "Snake"sv && key == "BaseColor"sv) {
set_skin_color(Color::from_argb(value));