From 035d63f5280c9ecc5241770841ccc782991922c2 Mon Sep 17 00:00:00 2001 From: James Puleo Date: Thu, 28 Jul 2022 02:49:15 -0400 Subject: [PATCH] HexEditor: Remove unused readonly flag `HexEditor::set_readonly` was never called, even though `HexEditor::is_readonly` was occasionally queried -- so it's entirely been removed. --- Userland/Applications/HexEditor/HexEditor.cpp | 9 +-------- Userland/Applications/HexEditor/HexEditor.h | 4 ---- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/Userland/Applications/HexEditor/HexEditor.cpp b/Userland/Applications/HexEditor/HexEditor.cpp index 463392230d..d27c7f9cd7 100644 --- a/Userland/Applications/HexEditor/HexEditor.cpp +++ b/Userland/Applications/HexEditor/HexEditor.cpp @@ -49,13 +49,6 @@ HexEditor::HexEditor() m_blink_timer->start(); } -void HexEditor::set_readonly(bool readonly) -{ - if (m_readonly == readonly) - return; - m_readonly = readonly; -} - bool HexEditor::open_new_file(size_t size) { auto maybe_buffer = ByteBuffer::create_zeroed(size); @@ -460,7 +453,7 @@ void HexEditor::keydown_event(GUI::KeyEvent& event) return; } - if (!is_readonly() && !event.ctrl() && !event.alt() && !event.text().is_empty()) { + if (!event.ctrl() && !event.alt() && !event.text().is_empty()) { if (m_edit_mode == EditMode::Hex) { hex_mode_keydown_event(event); } else { diff --git a/Userland/Applications/HexEditor/HexEditor.h b/Userland/Applications/HexEditor/HexEditor.h index 228be7f772..233a251e73 100644 --- a/Userland/Applications/HexEditor/HexEditor.h +++ b/Userland/Applications/HexEditor/HexEditor.h @@ -32,9 +32,6 @@ public: virtual ~HexEditor() override = default; - bool is_readonly() const { return m_readonly; } - void set_readonly(bool); - size_t buffer_size() const { return m_document->size(); } bool open_new_file(size_t size); void open_file(NonnullRefPtr file); @@ -74,7 +71,6 @@ protected: virtual void keydown_event(GUI::KeyEvent&) override; private: - bool m_readonly { false }; size_t m_line_spacing { 4 }; size_t m_content_length { 0 }; size_t m_bytes_per_row { 16 };