mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-05-04 18:27:42 +00:00
Everywhere: Rename {Deprecated => Byte}String
This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).
This commit is auto-generated:
$ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
Meta Ports Ladybird Tests Kernel)
$ perl -pie 's/\bDeprecatedString\b/ByteString/g;
s/deprecated_string/byte_string/g' $xs
$ clang-format --style=file -i \
$(git diff --name-only | grep \.cpp\|\.h)
$ gn format $(git ls-files '*.gn' '*.gni')
This commit is contained in:
committed by
Ali Mohammad Pur
parent
38d62563b3
commit
5e1499d104
@@ -87,17 +87,17 @@ void KeymapSwitcher::next_keymap()
|
||||
}
|
||||
}
|
||||
|
||||
DeprecatedString KeymapSwitcher::get_current_keymap() const
|
||||
ByteString KeymapSwitcher::get_current_keymap() const
|
||||
{
|
||||
auto proc_keymap = Core::File::open("/sys/kernel/keymap"sv, Core::File::OpenMode::Read).release_value_but_fixme_should_propagate_errors();
|
||||
auto proc_keymap_data = proc_keymap->read_until_eof().release_value_but_fixme_should_propagate_errors();
|
||||
auto json = JsonValue::from_string(proc_keymap_data).release_value_but_fixme_should_propagate_errors();
|
||||
auto const& keymap_object = json.as_object();
|
||||
VERIFY(keymap_object.has_string("keymap"sv));
|
||||
return keymap_object.get_deprecated_string("keymap"sv).value();
|
||||
return keymap_object.get_byte_string("keymap"sv).value();
|
||||
}
|
||||
|
||||
void KeymapSwitcher::set_keymap(const AK::DeprecatedString& keymap)
|
||||
void KeymapSwitcher::set_keymap(const AK::ByteString& keymap)
|
||||
{
|
||||
if (Core::Process::spawn("/bin/keymap"sv, Array { "-m", keymap.characters() }).is_error())
|
||||
dbgln("Failed to call /bin/keymap, error: {} ({})", errno, strerror(errno));
|
||||
|
||||
Reference in New Issue
Block a user