1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:17:34 +00:00

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.
This commit is contained in:
Ben Wiederhake 2021-10-31 23:38:04 +01:00 committed by Andreas Kling
parent 6b75a4dfc3
commit 465af4c4d4
13 changed files with 53 additions and 43 deletions

View file

@ -24,13 +24,6 @@ class ColorWidget : public GUI::Frame {
C_OBJECT(ColorWidget);
public:
explicit ColorWidget(Color color, PaletteWidget& palette_widget)
: m_palette_widget(palette_widget)
, m_color(color)
{
set_fixed_width(16);
}
virtual ~ColorWidget() override
{
}
@ -57,6 +50,13 @@ public:
}
private:
explicit ColorWidget(Color color, PaletteWidget& palette_widget)
: m_palette_widget(palette_widget)
, m_color(color)
{
set_fixed_width(16);
}
PaletteWidget& m_palette_widget;
Color m_color;
};
@ -87,6 +87,9 @@ public:
Function<void(Color const&)> on_color_change;
Color m_color = Color::White;
private:
SelectedColorWidget() = default;
};
PaletteWidget::PaletteWidget()