mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
KeyboardSettings: Port to Core::File
This commit is contained in:
parent
03008ec4e0
commit
58af4c85a4
Notes:
sideshowbarker
2024-07-17 07:38:17 +09:00
Author: https://github.com/cammo1123 Commit: https://github.com/SerenityOS/serenity/commit/58af4c85a4 Pull-request: https://github.com/SerenityOS/serenity/pull/18026 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/caoimhebyrne ✅ Reviewed-by: https://github.com/kleinesfilmroellchen ✅ Reviewed-by: https://github.com/linusg
1 changed files with 4 additions and 6 deletions
|
@ -13,8 +13,8 @@
|
|||
#include <Applications/KeyboardSettings/KeyboardWidgetGML.h>
|
||||
#include <Applications/KeyboardSettings/KeymapDialogGML.h>
|
||||
#include <LibConfig/Client.h>
|
||||
#include <LibCore/DeprecatedFile.h>
|
||||
#include <LibCore/Directory.h>
|
||||
#include <LibFileSystem/FileSystem.h>
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/ComboBox.h>
|
||||
#include <LibGUI/Dialog.h>
|
||||
|
@ -152,12 +152,10 @@ private:
|
|||
KeyboardSettingsWidget::KeyboardSettingsWidget()
|
||||
{
|
||||
load_from_gml(keyboard_widget_gml).release_value_but_fixme_should_propagate_errors();
|
||||
auto proc_keymap = MUST(Core::File::open("/sys/kernel/keymap"sv, Core::File::OpenMode::Read));
|
||||
|
||||
auto proc_keymap = Core::DeprecatedFile::construct("/sys/kernel/keymap");
|
||||
if (!proc_keymap->open(Core::OpenMode::ReadOnly))
|
||||
VERIFY_NOT_REACHED();
|
||||
|
||||
auto json = JsonValue::from_string(proc_keymap->read_all()).release_value_but_fixme_should_propagate_errors();
|
||||
auto keymap = proc_keymap->read_until_eof().release_value_but_fixme_should_propagate_errors();
|
||||
auto json = JsonValue::from_string(keymap).release_value_but_fixme_should_propagate_errors();
|
||||
auto const& keymap_object = json.as_object();
|
||||
VERIFY(keymap_object.has("keymap"sv));
|
||||
m_initial_active_keymap = keymap_object.get_deprecated_string("keymap"sv).value();
|
||||
|
|
Loading…
Reference in a new issue