summaryrefslogtreecommitdiff
path: root/Userland/Applications/KeyboardMapper
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2021-10-31 23:38:04 +0100
committerAndreas Kling <kling@serenityos.org>2021-11-02 22:56:53 +0100
commit465af4c4d4f403909208a420c21dbf7cf9cc015d (patch)
treeeac280a0bf8e2a6d852852bb2a4bb5a430967843 /Userland/Applications/KeyboardMapper
parent6b75a4dfc32e870e001cc2856fb4498069c39708 (diff)
downloadserenity-465af4c4d4f403909208a420c21dbf7cf9cc015d.zip
Applications: Fix visibility of Object-derivative constructors
Derivatives of Core::Object should be constructed through ClassName::construct(), to avoid handling ref-counted objects with refcount zero. Fixing the visibility means that misuses like this are more difficult.
Diffstat (limited to 'Userland/Applications/KeyboardMapper')
-rw-r--r--Userland/Applications/KeyboardMapper/KeyButton.h4
-rw-r--r--Userland/Applications/KeyboardMapper/KeyboardMapperWidget.h5
2 files changed, 6 insertions, 3 deletions
diff --git a/Userland/Applications/KeyboardMapper/KeyButton.h b/Userland/Applications/KeyboardMapper/KeyButton.h
index 6aed8d059a..38afde394a 100644
--- a/Userland/Applications/KeyboardMapper/KeyButton.h
+++ b/Userland/Applications/KeyboardMapper/KeyButton.h
@@ -8,7 +8,7 @@
#include <LibGUI/AbstractButton.h>
-class KeyButton : public GUI::AbstractButton {
+class KeyButton final : public GUI::AbstractButton {
C_OBJECT(KeyButton)
public:
@@ -25,5 +25,7 @@ protected:
virtual void paint_event(GUI::PaintEvent&) override;
private:
+ KeyButton() = default;
+
bool m_pressed { false };
};
diff --git a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.h b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.h
index 1c11dc17ca..84534be567 100644
--- a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.h
+++ b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.h
@@ -10,11 +10,10 @@
#include <LibGUI/Button.h>
#include <LibKeyboard/CharacterMapData.h>
-class KeyboardMapperWidget : public GUI::Widget {
+class KeyboardMapperWidget final : public GUI::Widget {
C_OBJECT(KeyboardMapperWidget)
public:
- KeyboardMapperWidget();
virtual ~KeyboardMapperWidget() override;
void create_frame();
@@ -31,6 +30,8 @@ protected:
void update_window_title();
private:
+ KeyboardMapperWidget();
+
Vector<KeyButton*> m_keys;
RefPtr<GUI::Widget> m_map_group;