diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2021-10-31 23:38:04 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-02 22:56:53 +0100 |
commit | 3796d417e00599c263c69ebf1ef4c0dcc52261a7 (patch) | |
tree | 3e81c30a95d1eafe3218dccc6d4a318290582cb1 | |
parent | 465af4c4d4f403909208a420c21dbf7cf9cc015d (diff) | |
download | serenity-3796d417e00599c263c69ebf1ef4c0dcc52261a7.zip |
Demos+DevTools+Games: 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.
6 files changed, 9 insertions, 5 deletions
diff --git a/Userland/Demos/Mandelbrot/Mandelbrot.cpp b/Userland/Demos/Mandelbrot/Mandelbrot.cpp index 882282972d..91926cf2d2 100644 --- a/Userland/Demos/Mandelbrot/Mandelbrot.cpp +++ b/Userland/Demos/Mandelbrot/Mandelbrot.cpp @@ -218,6 +218,8 @@ class Mandelbrot : public GUI::Frame { void reset(); private: + Mandelbrot() = default; + virtual void paint_event(GUI::PaintEvent&) override; virtual void mousedown_event(GUI::MouseEvent& event) override; virtual void mousemove_event(GUI::MouseEvent& event) override; diff --git a/Userland/DevTools/HackStudio/ClassViewWidget.h b/Userland/DevTools/HackStudio/ClassViewWidget.h index fa25c5f464..1b96ef1427 100644 --- a/Userland/DevTools/HackStudio/ClassViewWidget.h +++ b/Userland/DevTools/HackStudio/ClassViewWidget.h @@ -18,11 +18,12 @@ class ClassViewWidget final : public GUI::Widget { C_OBJECT(ClassViewWidget) public: virtual ~ClassViewWidget() override { } - ClassViewWidget(); void refresh(); private: + ClassViewWidget(); + RefPtr<GUI::TreeView> m_class_tree; }; diff --git a/Userland/DevTools/HackStudio/Debugger/EvaluateExpressionDialog.h b/Userland/DevTools/HackStudio/Debugger/EvaluateExpressionDialog.h index d67d984b5d..d140185f94 100644 --- a/Userland/DevTools/HackStudio/Debugger/EvaluateExpressionDialog.h +++ b/Userland/DevTools/HackStudio/Debugger/EvaluateExpressionDialog.h @@ -14,10 +14,9 @@ namespace HackStudio { class EvaluateExpressionDialog : public GUI::Dialog { C_OBJECT(EvaluateExpressionDialog); -public: +private: explicit EvaluateExpressionDialog(Window* parent_window); -private: void build(Window* parent_window); void handle_evaluation(const String& expression); void set_output(const StringView& html); diff --git a/Userland/DevTools/HackStudio/LanguageServers/Cpp/ClientConnection.h b/Userland/DevTools/HackStudio/LanguageServers/Cpp/ClientConnection.h index 5c88f59ac0..f67e888015 100644 --- a/Userland/DevTools/HackStudio/LanguageServers/Cpp/ClientConnection.h +++ b/Userland/DevTools/HackStudio/LanguageServers/Cpp/ClientConnection.h @@ -14,7 +14,7 @@ namespace LanguageServers::Cpp { class ClientConnection final : public LanguageServers::ClientConnection { C_OBJECT(ClientConnection); -public: +private: ClientConnection(NonnullRefPtr<Core::LocalSocket> socket, int client_id) : LanguageServers::ClientConnection(move(socket), client_id) { diff --git a/Userland/DevTools/HackStudio/LanguageServers/Shell/ClientConnection.h b/Userland/DevTools/HackStudio/LanguageServers/Shell/ClientConnection.h index 285f01920e..3eb2adbde6 100644 --- a/Userland/DevTools/HackStudio/LanguageServers/Shell/ClientConnection.h +++ b/Userland/DevTools/HackStudio/LanguageServers/Shell/ClientConnection.h @@ -15,6 +15,7 @@ namespace LanguageServers::Shell { class ClientConnection final : public LanguageServers::ClientConnection { C_OBJECT(ClientConnection); +private: ClientConnection(NonnullRefPtr<Core::LocalSocket> socket, int client_id) : LanguageServers::ClientConnection(move(socket), client_id) { diff --git a/Userland/Games/Minesweeper/Field.h b/Userland/Games/Minesweeper/Field.h index 015c6ec468..a550714948 100644 --- a/Userland/Games/Minesweeper/Field.h +++ b/Userland/Games/Minesweeper/Field.h @@ -43,7 +43,6 @@ class Field final : public GUI::Frame { friend class SquareLabel; public: - Field(GUI::Label& flag_label, GUI::Label& time_label, GUI::Button& face_button, Function<void(Gfx::IntSize)> on_size_changed); virtual ~Field() override; size_t rows() const { return m_rows; } @@ -58,6 +57,8 @@ public: void reset(); private: + Field(GUI::Label& flag_label, GUI::Label& time_label, GUI::Button& face_button, Function<void(Gfx::IntSize)> on_size_changed); + virtual void paint_event(GUI::PaintEvent&) override; void on_square_clicked(Square&); |