mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:37:35 +00:00
Services: Use default constructors/destructors
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
This commit is contained in:
parent
5550905c00
commit
0b7baa7e5a
80 changed files with 50 additions and 202 deletions
|
@ -25,10 +25,6 @@ AppletManager::AppletManager()
|
|||
order_vector = order.split(',');
|
||||
}
|
||||
|
||||
AppletManager::~AppletManager()
|
||||
{
|
||||
}
|
||||
|
||||
AppletManager& AppletManager::the()
|
||||
{
|
||||
VERIFY(s_the);
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace WindowServer {
|
|||
class AppletManager : public Core::Object {
|
||||
C_OBJECT(AppletManager)
|
||||
public:
|
||||
~AppletManager();
|
||||
~AppletManager() = default;
|
||||
|
||||
static AppletManager& the();
|
||||
|
||||
|
|
|
@ -20,9 +20,7 @@ Button::Button(WindowFrame& frame, Function<void(Button&)>&& on_click_handler)
|
|||
{
|
||||
}
|
||||
|
||||
Button::~Button()
|
||||
{
|
||||
}
|
||||
Button::~Button() = default;
|
||||
|
||||
void Button::paint(Screen& screen, Gfx::Painter& painter)
|
||||
{
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
Gfx::IntSize size() const { return m_rect.size(); }
|
||||
|
||||
private:
|
||||
Cursor() { }
|
||||
Cursor() = default;
|
||||
Cursor(NonnullRefPtr<Gfx::Bitmap>&&, int, const Gfx::CursorParams&);
|
||||
|
||||
bool load(StringView, StringView);
|
||||
|
|
|
@ -37,12 +37,12 @@ public:
|
|||
WindowResized,
|
||||
};
|
||||
|
||||
Event() { }
|
||||
Event() = default;
|
||||
explicit Event(Type type)
|
||||
: Core::Event(type)
|
||||
{
|
||||
}
|
||||
virtual ~Event() { }
|
||||
virtual ~Event() = default;
|
||||
|
||||
bool is_mouse_event() const { return type() == MouseMove || type() == MouseDown || type() == MouseDoubleClick || type() == MouseUp || type() == MouseWheel; }
|
||||
bool is_key_event() const { return type() == KeyUp || type() == KeyDown; }
|
||||
|
|
|
@ -41,10 +41,6 @@ EventLoop::EventLoop()
|
|||
}
|
||||
}
|
||||
|
||||
EventLoop::~EventLoop()
|
||||
{
|
||||
}
|
||||
|
||||
void EventLoop::drain_mouse()
|
||||
{
|
||||
auto& screen_input = ScreenInput::the();
|
||||
|
|
|
@ -20,7 +20,7 @@ class ConnectionFromClient;
|
|||
class EventLoop {
|
||||
public:
|
||||
EventLoop();
|
||||
virtual ~EventLoop();
|
||||
virtual ~EventLoop() = default;
|
||||
|
||||
int exec() { return m_event_loop.exec(); }
|
||||
|
||||
|
|
|
@ -26,10 +26,6 @@ KeymapSwitcher::KeymapSwitcher()
|
|||
refresh();
|
||||
}
|
||||
|
||||
KeymapSwitcher::~KeymapSwitcher()
|
||||
{
|
||||
}
|
||||
|
||||
void KeymapSwitcher::refresh()
|
||||
{
|
||||
m_keymaps.clear();
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace WindowServer {
|
|||
class KeymapSwitcher final : public Core::Object {
|
||||
C_OBJECT(KeymapSwitcher)
|
||||
public:
|
||||
virtual ~KeymapSwitcher() override;
|
||||
virtual ~KeymapSwitcher() override = default;
|
||||
|
||||
void next_keymap();
|
||||
|
||||
|
|
|
@ -47,10 +47,6 @@ Menu::Menu(ConnectionFromClient* client, int menu_id, String name)
|
|||
m_alt_shortcut_character = find_ampersand_shortcut_character(m_name);
|
||||
}
|
||||
|
||||
Menu::~Menu()
|
||||
{
|
||||
}
|
||||
|
||||
const Gfx::Font& Menu::font() const
|
||||
{
|
||||
return Gfx::FontDatabase::default_font();
|
||||
|
|
|
@ -28,7 +28,7 @@ class Menu final : public Core::Object {
|
|||
C_OBJECT(Menu);
|
||||
|
||||
public:
|
||||
virtual ~Menu() override;
|
||||
virtual ~Menu() override = default;
|
||||
|
||||
ConnectionFromClient* client() { return m_client; }
|
||||
const ConnectionFromClient* client() const { return m_client; }
|
||||
|
|
|
@ -31,10 +31,6 @@ MenuItem::MenuItem(Menu& menu, Type type)
|
|||
{
|
||||
}
|
||||
|
||||
MenuItem::~MenuItem()
|
||||
{
|
||||
}
|
||||
|
||||
void MenuItem::set_enabled(bool enabled)
|
||||
{
|
||||
if (m_enabled == enabled)
|
||||
|
|
|
@ -25,7 +25,7 @@ public:
|
|||
|
||||
MenuItem(Menu&, unsigned identifier, const String& text, const String& shortcut_text = {}, bool enabled = true, bool checkable = false, bool checked = false, const Gfx::Bitmap* icon = nullptr);
|
||||
MenuItem(Menu&, Type);
|
||||
~MenuItem();
|
||||
~MenuItem() = default;
|
||||
|
||||
Type type() const { return m_type; }
|
||||
|
||||
|
|
|
@ -26,10 +26,6 @@ MenuManager::MenuManager()
|
|||
s_the = this;
|
||||
}
|
||||
|
||||
MenuManager::~MenuManager()
|
||||
{
|
||||
}
|
||||
|
||||
bool MenuManager::is_open(const Menu& menu) const
|
||||
{
|
||||
for (size_t i = 0; i < m_open_menu_stack.size(); ++i) {
|
||||
|
|
|
@ -20,7 +20,7 @@ class MenuManager final : public Core::Object {
|
|||
public:
|
||||
static MenuManager& the();
|
||||
|
||||
virtual ~MenuManager() override;
|
||||
virtual ~MenuManager() override = default;
|
||||
|
||||
bool is_open(const Menu&) const;
|
||||
bool has_open_menu() const { return !m_open_menu_stack.is_empty(); }
|
||||
|
|
|
@ -112,9 +112,7 @@ void WindowFrame::window_was_constructed(Badge<Window>)
|
|||
m_has_alpha_channel = Gfx::WindowTheme::current().frame_uses_alpha(window_state_for_theme(), WindowManager::the().palette());
|
||||
}
|
||||
|
||||
WindowFrame::~WindowFrame()
|
||||
{
|
||||
}
|
||||
WindowFrame::~WindowFrame() = default;
|
||||
|
||||
void WindowFrame::set_button_icons()
|
||||
{
|
||||
|
|
|
@ -68,10 +68,6 @@ WindowManager::WindowManager(Gfx::PaletteImpl const& palette)
|
|||
Compositor::the().did_construct_window_manager({});
|
||||
}
|
||||
|
||||
WindowManager::~WindowManager()
|
||||
{
|
||||
}
|
||||
|
||||
void WindowManager::reload_config()
|
||||
{
|
||||
m_config = Core::ConfigFile::open("/etc/WindowServer.ini", Core::ConfigFile::AllowWriting::Yes).release_value_but_fixme_should_propagate_errors();
|
||||
|
|
|
@ -69,7 +69,7 @@ public:
|
|||
|
||||
static WindowManager& the();
|
||||
|
||||
virtual ~WindowManager() override;
|
||||
virtual ~WindowManager() override = default;
|
||||
|
||||
Palette palette() const { return Palette(*m_palette); }
|
||||
|
||||
|
|
|
@ -15,10 +15,6 @@ WindowStack::WindowStack(unsigned row, unsigned column)
|
|||
{
|
||||
}
|
||||
|
||||
WindowStack::~WindowStack()
|
||||
{
|
||||
}
|
||||
|
||||
void WindowStack::add(Window& window)
|
||||
{
|
||||
VERIFY(!window.is_on_any_window_stack({}));
|
||||
|
|
|
@ -16,7 +16,7 @@ class Compositor;
|
|||
class WindowStack {
|
||||
public:
|
||||
WindowStack(unsigned row, unsigned column);
|
||||
~WindowStack();
|
||||
~WindowStack() = default;
|
||||
|
||||
bool is_empty() const { return m_windows.is_empty(); }
|
||||
void add(Window&);
|
||||
|
|
|
@ -28,10 +28,6 @@ WindowSwitcher::WindowSwitcher()
|
|||
s_the = this;
|
||||
}
|
||||
|
||||
WindowSwitcher::~WindowSwitcher()
|
||||
{
|
||||
}
|
||||
|
||||
void WindowSwitcher::set_visible(bool visible)
|
||||
{
|
||||
if (m_visible == visible)
|
||||
|
|
|
@ -26,7 +26,7 @@ public:
|
|||
};
|
||||
static WindowSwitcher& the();
|
||||
|
||||
virtual ~WindowSwitcher() override;
|
||||
virtual ~WindowSwitcher() override = default;
|
||||
|
||||
bool is_visible() const { return m_visible; }
|
||||
void set_visible(bool);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue