Skip to content

Commit

Permalink
KeyboardSettings: Port to Core::File
Browse files Browse the repository at this point in the history
  • Loading branch information
cammo1123 authored and ADKaster committed Apr 10, 2023
1 parent 03008ec commit 58af4c8
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -152,12 +152,10 @@ class KeymapModel final : public GUI::Model {
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();
Expand Down

0 comments on commit 58af4c8

Please sign in to comment.