diff options
Diffstat (limited to 'Userland')
146 files changed, 271 insertions, 462 deletions
diff --git a/Userland/Libraries/LibGUI/AboutDialog.cpp b/Userland/Libraries/LibGUI/AboutDialog.cpp index 9791cb618f..c0ae44b967 100644 --- a/Userland/Libraries/LibGUI/AboutDialog.cpp +++ b/Userland/Libraries/LibGUI/AboutDialog.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -85,8 +86,4 @@ AboutDialog::AboutDialog(StringView name, const Gfx::Bitmap* icon, Window* paren }; } -AboutDialog::~AboutDialog() -{ -} - } diff --git a/Userland/Libraries/LibGUI/AboutDialog.h b/Userland/Libraries/LibGUI/AboutDialog.h index 840ae8295e..4fb3ac3ee4 100644 --- a/Userland/Libraries/LibGUI/AboutDialog.h +++ b/Userland/Libraries/LibGUI/AboutDialog.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -14,7 +15,7 @@ namespace GUI { class AboutDialog final : public Dialog { C_OBJECT(AboutDialog) public: - virtual ~AboutDialog() override; + virtual ~AboutDialog() override = default; static void show(StringView name, const Gfx::Bitmap* icon = nullptr, Window* parent_window = nullptr, const Gfx::Bitmap* window_icon = nullptr, StringView version = Core::Version::SERENITY_VERSION) { diff --git a/Userland/Libraries/LibGUI/AbstractButton.cpp b/Userland/Libraries/LibGUI/AbstractButton.cpp index 2a682f30ab..4697c490b0 100644 --- a/Userland/Libraries/LibGUI/AbstractButton.cpp +++ b/Userland/Libraries/LibGUI/AbstractButton.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -32,10 +33,6 @@ AbstractButton::AbstractButton(String text) REGISTER_BOOL_PROPERTY("exclusive", is_exclusive, set_exclusive); } -AbstractButton::~AbstractButton() -{ -} - void AbstractButton::set_text(String text) { if (m_text == text) diff --git a/Userland/Libraries/LibGUI/AbstractButton.h b/Userland/Libraries/LibGUI/AbstractButton.h index 649d713dd2..40c3b71d56 100644 --- a/Userland/Libraries/LibGUI/AbstractButton.h +++ b/Userland/Libraries/LibGUI/AbstractButton.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -15,7 +16,7 @@ class AbstractButton : public Widget { C_OBJECT_ABSTRACT(AbstractButton); public: - virtual ~AbstractButton() override; + virtual ~AbstractButton() override = default; Function<void(bool)> on_checked; diff --git a/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp b/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp index 77ec27eda2..b1a022f1a9 100644 --- a/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp +++ b/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -37,10 +38,6 @@ AbstractScrollableWidget::AbstractScrollableWidget() }; } -AbstractScrollableWidget::~AbstractScrollableWidget() -{ -} - void AbstractScrollableWidget::handle_wheel_event(MouseEvent& event, Widget& event_source) { if (!m_scrollbars_enabled) { diff --git a/Userland/Libraries/LibGUI/AbstractScrollableWidget.h b/Userland/Libraries/LibGUI/AbstractScrollableWidget.h index 01a6647abb..fdc3ff5d12 100644 --- a/Userland/Libraries/LibGUI/AbstractScrollableWidget.h +++ b/Userland/Libraries/LibGUI/AbstractScrollableWidget.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -15,7 +16,7 @@ class AbstractScrollableWidget : public Frame { C_OBJECT_ABSTRACT(AbstractScrollableWidget); public: - virtual ~AbstractScrollableWidget() override; + virtual ~AbstractScrollableWidget() override = default; Gfx::IntSize content_size() const { return m_content_size; } int content_width() const { return m_content_size.width(); } diff --git a/Userland/Libraries/LibGUI/AbstractSlider.cpp b/Userland/Libraries/LibGUI/AbstractSlider.cpp index 97b353b3c4..9759df20fe 100644 --- a/Userland/Libraries/LibGUI/AbstractSlider.cpp +++ b/Userland/Libraries/LibGUI/AbstractSlider.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -25,10 +26,6 @@ AbstractSlider::AbstractSlider(Orientation orientation) { Orientation::Vertical, "Vertical" }); } -AbstractSlider::~AbstractSlider() -{ -} - void AbstractSlider::set_orientation(Orientation value) { if (m_orientation == value) diff --git a/Userland/Libraries/LibGUI/AbstractSlider.h b/Userland/Libraries/LibGUI/AbstractSlider.h index 10e3fc829d..83c29254d8 100644 --- a/Userland/Libraries/LibGUI/AbstractSlider.h +++ b/Userland/Libraries/LibGUI/AbstractSlider.h @@ -14,7 +14,7 @@ class AbstractSlider : public Widget { C_OBJECT_ABSTRACT(AbstractSlider); public: - virtual ~AbstractSlider() override; + virtual ~AbstractSlider() override = default; void set_orientation(Orientation value); Orientation orientation() const { return m_orientation; } diff --git a/Userland/Libraries/LibGUI/AbstractTableView.cpp b/Userland/Libraries/LibGUI/AbstractTableView.cpp index 91fb4d33bd..eded7cf084 100644 --- a/Userland/Libraries/LibGUI/AbstractTableView.cpp +++ b/Userland/Libraries/LibGUI/AbstractTableView.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -34,10 +35,6 @@ AbstractTableView::AbstractTableView() set_should_hide_unnecessary_scrollbars(true); } -AbstractTableView::~AbstractTableView() -{ -} - void AbstractTableView::select_all() { selection().clear(); diff --git a/Userland/Libraries/LibGUI/AbstractTableView.h b/Userland/Libraries/LibGUI/AbstractTableView.h index 996f33487b..d4e43b00ce 100644 --- a/Userland/Libraries/LibGUI/AbstractTableView.h +++ b/Userland/Libraries/LibGUI/AbstractTableView.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> * Copyright (c) 2022, Jakob-Niklas See <git@nwex.de> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -8,12 +9,14 @@ #pragma once #include <LibGUI/AbstractView.h> +#include <LibGUI/Button.h> +#include <LibGUI/HeaderView.h> namespace GUI { class TableCellPaintingDelegate { public: - virtual ~TableCellPaintingDelegate() { } + virtual ~TableCellPaintingDelegate() = default; virtual bool should_paint(ModelIndex const&) { return true; } virtual void paint(Painter&, const Gfx::IntRect&, const Gfx::Palette&, const ModelIndex&) = 0; @@ -82,7 +85,7 @@ public: virtual void model_did_update(unsigned flags) override; protected: - virtual ~AbstractTableView() override; + virtual ~AbstractTableView() override = default; AbstractTableView(); virtual void mousedown_event(MouseEvent&) override; diff --git a/Userland/Libraries/LibGUI/Action.h b/Userland/Libraries/LibGUI/Action.h index 7823796714..b1eca83b7a 100644 --- a/Userland/Libraries/LibGUI/Action.h +++ b/Userland/Libraries/LibGUI/Action.h @@ -15,6 +15,7 @@ #include <AK/WeakPtr.h> #include <AK/Weakable.h> #include <LibCore/Object.h> +#include <LibCore/Timer.h> #include <LibGUI/Forward.h> #include <LibGUI/Shortcut.h> #include <LibGfx/Forward.h> diff --git a/Userland/Libraries/LibGUI/ActionGroup.h b/Userland/Libraries/LibGUI/ActionGroup.h index 090b7c0d9e..505b413ca2 100644 --- a/Userland/Libraries/LibGUI/ActionGroup.h +++ b/Userland/Libraries/LibGUI/ActionGroup.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -14,8 +15,8 @@ namespace GUI { class ActionGroup : public Weakable<ActionGroup> { public: - ActionGroup() { } - ~ActionGroup() { } + ActionGroup() = default; + ~ActionGroup() = default; void add_action(Action&); void remove_action(Action&); diff --git a/Userland/Libraries/LibGUI/AutocompleteProvider.cpp b/Userland/Libraries/LibGUI/AutocompleteProvider.cpp index 87104bcfc3..82a46800f2 100644 --- a/Userland/Libraries/LibGUI/AutocompleteProvider.cpp +++ b/Userland/Libraries/LibGUI/AutocompleteProvider.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, the SerenityOS developers. + * Copyright (c) 2020-2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -84,8 +84,6 @@ private: Vector<AutocompleteProvider::Entry> m_suggestions; }; -AutocompleteBox::~AutocompleteBox() { } - AutocompleteBox::AutocompleteBox(TextEditor& editor) : m_editor(editor) { diff --git a/Userland/Libraries/LibGUI/AutocompleteProvider.h b/Userland/Libraries/LibGUI/AutocompleteProvider.h index 4bdebc7a2d..d9e9573918 100644 --- a/Userland/Libraries/LibGUI/AutocompleteProvider.h +++ b/Userland/Libraries/LibGUI/AutocompleteProvider.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, the SerenityOS developers. + * Copyright (c) 2020-2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -20,7 +20,7 @@ class AutocompleteProvider { AK_MAKE_NONMOVABLE(AutocompleteProvider); public: - virtual ~AutocompleteProvider() { } + virtual ~AutocompleteProvider() = default; enum class Language { Unspecified, @@ -103,7 +103,7 @@ public: void detach() { m_editor.clear(); } protected: - AutocompleteProvider() { } + AutocompleteProvider() = default; WeakPtr<TextEditor> m_editor; }; @@ -111,7 +111,7 @@ protected: class AutocompleteBox final { public: explicit AutocompleteBox(TextEditor&); - ~AutocompleteBox(); + ~AutocompleteBox() = default; void update_suggestions(Vector<AutocompleteProvider::Entry>&& suggestions); bool is_visible() const; diff --git a/Userland/Libraries/LibGUI/BoxLayout.h b/Userland/Libraries/LibGUI/BoxLayout.h index 433c5bf4bb..6e6921d59c 100644 --- a/Userland/Libraries/LibGUI/BoxLayout.h +++ b/Userland/Libraries/LibGUI/BoxLayout.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -16,7 +17,7 @@ class BoxLayout : public Layout { C_OBJECT(BoxLayout); public: - virtual ~BoxLayout() override { } + virtual ~BoxLayout() override = default; Gfx::Orientation orientation() const { return m_orientation; } @@ -41,7 +42,7 @@ private: : BoxLayout(Gfx::Orientation::Vertical) { } - virtual ~VerticalBoxLayout() override { } + virtual ~VerticalBoxLayout() override = default; }; class HorizontalBoxLayout final : public BoxLayout { @@ -52,7 +53,7 @@ private: : BoxLayout(Gfx::Orientation::Horizontal) { } - virtual ~HorizontalBoxLayout() override { } + virtual ~HorizontalBoxLayout() override = default; }; } diff --git a/Userland/Libraries/LibGUI/Breadcrumbbar.cpp b/Userland/Libraries/LibGUI/Breadcrumbbar.cpp index 8c0f29b591..3cf593c470 100644 --- a/Userland/Libraries/LibGUI/Breadcrumbbar.cpp +++ b/Userland/Libraries/LibGUI/Breadcrumbbar.cpp @@ -1,6 +1,7 @@ /* * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> * Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -20,7 +21,7 @@ class BreadcrumbButton : public Button { C_OBJECT(BreadcrumbButton); public: - virtual ~BreadcrumbButton() override { } + virtual ~BreadcrumbButton() override = default; virtual bool is_uncheckable() const override { return false; } virtual void drop_event(DropEvent& event) override @@ -54,7 +55,7 @@ public: Function<void(DragEvent&)> on_drag_enter; private: - BreadcrumbButton() { } + BreadcrumbButton() = default; }; Breadcrumbbar::Breadcrumbbar() @@ -63,10 +64,6 @@ Breadcrumbbar::Breadcrumbbar() layout.set_spacing(0); } -Breadcrumbbar::~Breadcrumbbar() -{ -} - void Breadcrumbbar::clear_segments() { m_segments.clear(); diff --git a/Userland/Libraries/LibGUI/Breadcrumbbar.h b/Userland/Libraries/LibGUI/Breadcrumbbar.h index b07dbe3951..93515eada3 100644 --- a/Userland/Libraries/LibGUI/Breadcrumbbar.h +++ b/Userland/Libraries/LibGUI/Breadcrumbbar.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -14,7 +15,7 @@ class Breadcrumbbar : public GUI::Widget { C_OBJECT(Breadcrumbbar); public: - virtual ~Breadcrumbbar() override; + virtual ~Breadcrumbbar() override = default; void clear_segments(); void append_segment(String text, Gfx::Bitmap const* icon = nullptr, String data = {}, String tooltip = {}); diff --git a/Userland/Libraries/LibGUI/Button.h b/Userland/Libraries/LibGUI/Button.h index 5cb06ef25d..73c4102a81 100644 --- a/Userland/Libraries/LibGUI/Button.h +++ b/Userland/Libraries/LibGUI/Button.h @@ -8,6 +8,7 @@ #include <AK/Function.h> #include <LibGUI/AbstractButton.h> +#include <LibGUI/Action.h> #include <LibGfx/Bitmap.h> #include <LibGfx/StylePainter.h> #include <LibGfx/TextAlignment.h> diff --git a/Userland/Libraries/LibGUI/CMakeLists.txt b/Userland/Libraries/LibGUI/CMakeLists.txt index 48fb661c9b..cc10cbfbd4 100644 --- a/Userland/Libraries/LibGUI/CMakeLists.txt +++ b/Userland/Libraries/LibGUI/CMakeLists.txt @@ -26,7 +26,6 @@ set(SOURCES CommonActions.cpp CommonLocationsProvider.cpp ComboBox.cpp - Command.cpp CommandPalette.cpp Desktop.cpp Dialog.cpp diff --git a/Userland/Libraries/LibGUI/Calendar.cpp b/Userland/Libraries/LibGUI/Calendar.cpp index 229b036551..06f9f2ca1a 100644 --- a/Userland/Libraries/LibGUI/Calendar.cpp +++ b/Userland/Libraries/LibGUI/Calendar.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2019-2020, Ryan Grieb <ryan.m.grieb@gmail.com> - * Copyright (c) 2020-2021, the SerenityOS developers. + * Copyright (c) 2020-2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -62,10 +62,6 @@ Calendar::Calendar(Core::DateTime date_time, Mode mode) update_tiles(m_selected_date.year(), m_selected_date.month()); } -Calendar::~Calendar() -{ -} - void Calendar::set_grid(bool show) { if (m_grid == show) diff --git a/Userland/Libraries/LibGUI/Calendar.h b/Userland/Libraries/LibGUI/Calendar.h index 017a1182b2..72d653fc6e 100644 --- a/Userland/Libraries/LibGUI/Calendar.h +++ b/Userland/Libraries/LibGUI/Calendar.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2019-2020, Ryan Grieb <ryan.m.grieb@gmail.com> - * Copyright (c) 2020-2021, the SerenityOS developers. + * Copyright (c) 2020-2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -73,7 +73,7 @@ public: private: Calendar(Core::DateTime date_time = Core::DateTime::now(), Mode mode = Month); - virtual ~Calendar() override; + virtual ~Calendar() override = default; virtual void resize_event(GUI::ResizeEvent&) override; virtual void paint_event(GUI::PaintEvent&) override; diff --git a/Userland/Libraries/LibGUI/CheckBox.cpp b/Userland/Libraries/LibGUI/CheckBox.cpp index 2cfd26d88c..207df1f0c0 100644 --- a/Userland/Libraries/LibGUI/CheckBox.cpp +++ b/Userland/Libraries/LibGUI/CheckBox.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -28,10 +29,6 @@ CheckBox::CheckBox(String text) set_fixed_height(22); } -CheckBox::~CheckBox() -{ -} - void CheckBox::paint_event(PaintEvent& event) { Painter painter(*this); diff --git a/Userland/Libraries/LibGUI/CheckBox.h b/Userland/Libraries/LibGUI/CheckBox.h index 6a66300152..bbc882f6a8 100644 --- a/Userland/Libraries/LibGUI/CheckBox.h +++ b/Userland/Libraries/LibGUI/CheckBox.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -14,7 +15,7 @@ class CheckBox : public AbstractButton { C_OBJECT(CheckBox); public: - virtual ~CheckBox() override; + virtual ~CheckBox() override = default; virtual void click(unsigned modifiers = 0) override; diff --git a/Userland/Libraries/LibGUI/ColorInput.cpp b/Userland/Libraries/LibGUI/ColorInput.cpp index 383df59025..ec52400982 100644 --- a/Userland/Libraries/LibGUI/ColorInput.cpp +++ b/Userland/Libraries/LibGUI/ColorInput.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Hüseyin Aslıtürk <asliturk@hotmail.com> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -29,10 +30,6 @@ ColorInput::ColorInput() REGISTER_BOOL_PROPERTY("has_alpha_channel", has_alpha_channel, set_color_has_alpha_channel); } -ColorInput::~ColorInput() -{ -} - Gfx::IntRect ColorInput::color_rect() const { auto color_box_padding = 3; diff --git a/Userland/Libraries/LibGUI/ColorInput.h b/Userland/Libraries/LibGUI/ColorInput.h index 32c6467838..099478cef5 100644 --- a/Userland/Libraries/LibGUI/ColorInput.h +++ b/Userland/Libraries/LibGUI/ColorInput.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Hüseyin Aslıtürk <asliturk@hotmail.com> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -15,7 +16,7 @@ class ColorInput final : public TextEditor { C_OBJECT(ColorInput); public: - virtual ~ColorInput() override; + virtual ~ColorInput() override = default; bool has_alpha_channel() const { return m_color_has_alpha_channel; } void set_color_has_alpha_channel(bool has_alpha) { m_color_has_alpha_channel = has_alpha; } diff --git a/Userland/Libraries/LibGUI/ColorPicker.cpp b/Userland/Libraries/LibGUI/ColorPicker.cpp index 4736c451e2..3711d7858e 100644 --- a/Userland/Libraries/LibGUI/ColorPicker.cpp +++ b/Userland/Libraries/LibGUI/ColorPicker.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -22,7 +23,7 @@ class ColorButton : public AbstractButton { C_OBJECT(ColorButton); public: - virtual ~ColorButton() override; + virtual ~ColorButton() override = default; void set_selected(bool selected); Color color() const { return m_color; } @@ -146,7 +147,7 @@ public: return m_col; } - virtual ~ColorSelectOverlay() override { } + virtual ~ColorSelectOverlay() override = default; Function<void(Color)> on_color_changed; private: @@ -193,10 +194,6 @@ ColorPicker::ColorPicker(Color color, Window* parent_window, String title) build_ui(); } -ColorPicker::~ColorPicker() -{ -} - void ColorPicker::set_color_has_alpha_channel(bool has_alpha) { if (m_color_has_alpha_channel == has_alpha) @@ -458,10 +455,6 @@ ColorButton::ColorButton(ColorPicker& picker, Color color) m_color = color; } -ColorButton::~ColorButton() -{ -} - void ColorButton::set_selected(bool selected) { m_selected = selected; diff --git a/Userland/Libraries/LibGUI/ColorPicker.h b/Userland/Libraries/LibGUI/ColorPicker.h index fb9ed0eee3..2021e85851 100644 --- a/Userland/Libraries/LibGUI/ColorPicker.h +++ b/Userland/Libraries/LibGUI/ColorPicker.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -20,7 +21,7 @@ class ColorPicker final : public Dialog { C_OBJECT(ColorPicker) public: - virtual ~ColorPicker() override; + virtual ~ColorPicker() override = default; bool color_has_alpha_channel() const { return m_color_has_alpha_channel; } void set_color_has_alpha_channel(bool); diff --git a/Userland/Libraries/LibGUI/ColumnsView.cpp b/Userland/Libraries/LibGUI/ColumnsView.cpp index 6b409656ac..67ba0bce1b 100644 --- a/Userland/Libraries/LibGUI/ColumnsView.cpp +++ b/Userland/Libraries/LibGUI/ColumnsView.cpp @@ -35,10 +35,6 @@ ColumnsView::ColumnsView() m_columns.append({ {}, 0 }); } -ColumnsView::~ColumnsView() -{ -} - void ColumnsView::select_all() { Vector<Column> columns_for_selection; diff --git a/Userland/Libraries/LibGUI/ColumnsView.h b/Userland/Libraries/LibGUI/ColumnsView.h index d0c7a29dee..3f37463106 100644 --- a/Userland/Libraries/LibGUI/ColumnsView.h +++ b/Userland/Libraries/LibGUI/ColumnsView.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Sergey Bugaev <bugaevc@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -23,7 +24,7 @@ public: private: ColumnsView(); - virtual ~ColumnsView() override; + virtual ~ColumnsView() override = default; void push_column(const ModelIndex& parent_index); void update_column_sizes(); diff --git a/Userland/Libraries/LibGUI/ComboBox.cpp b/Userland/Libraries/LibGUI/ComboBox.cpp index 8060764999..294461fc45 100644 --- a/Userland/Libraries/LibGUI/ComboBox.cpp +++ b/Userland/Libraries/LibGUI/ComboBox.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -137,9 +138,7 @@ ComboBox::ComboBox() }; } -ComboBox::~ComboBox() -{ -} +ComboBox::~ComboBox() = default; void ComboBox::set_editor_placeholder(StringView placeholder) { diff --git a/Userland/Libraries/LibGUI/Command.cpp b/Userland/Libraries/LibGUI/Command.cpp deleted file mode 100644 index c13917e926..0000000000 --- a/Userland/Libraries/LibGUI/Command.cpp +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> - * - * SPDX-License-Identifier: BSD-2-Clause - */ - -#include <LibGUI/Command.h> - -namespace GUI { - -Command::~Command() -{ -} - -} diff --git a/Userland/Libraries/LibGUI/Command.h b/Userland/Libraries/LibGUI/Command.h index e7db7d7678..1bff5a10d0 100644 --- a/Userland/Libraries/LibGUI/Command.h +++ b/Userland/Libraries/LibGUI/Command.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -12,7 +13,7 @@ namespace GUI { class Command { public: - virtual ~Command(); + virtual ~Command() = default; virtual void undo() { } virtual void redo() { } @@ -21,7 +22,7 @@ public: virtual bool merge_with(Command const&) { return false; } protected: - Command() { } + Command() = default; }; } diff --git a/Userland/Libraries/LibGUI/CommandPalette.cpp b/Userland/Libraries/LibGUI/CommandPalette.cpp index 78ac413071..81b502e400 100644 --- a/Userland/Libraries/LibGUI/CommandPalette.cpp +++ b/Userland/Libraries/LibGUI/CommandPalette.cpp @@ -1,6 +1,7 @@ /* * Copyright (c) 2022, Andreas Kling <kling@serenityos.org> * Copyright (c) 2022, Jakob-Niklas See <git@nwex.de> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -34,7 +35,7 @@ AK_ENUM_BITWISE_OPERATORS(IconFlags); class ActionIconDelegate final : public GUI::TableCellPaintingDelegate { public: - virtual ~ActionIconDelegate() override { } + virtual ~ActionIconDelegate() override = default; bool should_paint(ModelIndex const& index) override { @@ -76,7 +77,7 @@ public: { } - virtual ~ActionModel() override { } + virtual ~ActionModel() override = default; virtual int row_count(ModelIndex const& parent_index) const override { @@ -218,10 +219,6 @@ CommandPalette::CommandPalette(GUI::Window& parent_window, ScreenPosition screen m_text_box->set_focus(true); } -CommandPalette::~CommandPalette() -{ -} - void CommandPalette::collect_actions(GUI::Window& parent_window) { OrderedHashTable<NonnullRefPtr<GUI::Action>> actions; diff --git a/Userland/Libraries/LibGUI/CommandPalette.h b/Userland/Libraries/LibGUI/CommandPalette.h index 998f7f489e..5e1853c7ab 100644 --- a/Userland/Libraries/LibGUI/CommandPalette.h +++ b/Userland/Libraries/LibGUI/CommandPalette.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2022, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -20,7 +21,7 @@ public: private: explicit CommandPalette(GUI::Window& parent_window, ScreenPosition screen_position = CenterWithinParent); - virtual ~CommandPalette() override; + virtual ~CommandPalette() override = default; void collect_actions(GUI::Window& parent_window); void finish_with_index(GUI::ModelIndex const&); diff --git a/Userland/Libraries/LibGUI/Desktop.cpp b/Userland/Libraries/LibGUI/Desktop.cpp index 81003eeae1..f962a005c9 100644 --- a/Userland/Libraries/LibGUI/Desktop.cpp +++ b/Userland/Libraries/LibGUI/Desktop.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -21,10 +22,6 @@ Desktop& Desktop::the() return s_the; } -Desktop::Desktop() -{ -} - void Desktop::did_receive_screen_rects(Badge<ConnectionToWindowServer>, const Vector<Gfx::IntRect, 4>& rects, size_t main_screen_index, unsigned workspace_rows, unsigned workspace_columns) { m_main_screen_index = main_screen_index; diff --git a/Userland/Libraries/LibGUI/Desktop.h b/Userland/Libraries/LibGUI/Desktop.h index 788aef4785..82f5143fb3 100644 --- a/Userland/Libraries/LibGUI/Desktop.h +++ b/Userland/Libraries/LibGUI/Desktop.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -23,7 +24,7 @@ public: static constexpr size_t default_screen_rect_count = 4; static Desktop& the(); - Desktop(); + Desktop() = default; void set_background_color(StringView background_color); diff --git a/Userland/Libraries/LibGUI/Dialog.cpp b/Userland/Libraries/LibGUI/Dialog.cpp index 2993433d12..07d6cdb36c 100644 --- a/Userland/Libraries/LibGUI/Dialog.cpp +++ b/Userland/Libraries/LibGUI/Dialog.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -19,10 +20,6 @@ Dialog::Dialog(Window* parent_window, ScreenPosition screen_position) set_minimizable(false); } -Dialog::~Dialog() -{ -} - int Dialog::exec() { VERIFY(!m_event_loop); diff --git a/Userland/Libraries/LibGUI/Dialog.h b/Userland/Libraries/LibGUI/Dialog.h index 8fccf6ab50..259e346261 100644 --- a/Userland/Libraries/LibGUI/Dialog.h +++ b/Userland/Libraries/LibGUI/Dialog.h @@ -1,11 +1,13 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once +#include <LibCore/EventLoop.h> #include <LibGUI/Window.h> namespace GUI { @@ -36,7 +38,7 @@ public: BottomRight = 9, }; - virtual ~Dialog() override; + virtual ~Dialog() override = default; int exec(); diff --git a/Userland/Libraries/LibGUI/DragOperation.cpp b/Userland/Libraries/LibGUI/DragOperation.cpp index c521f90bdc..839b1f8aef 100644 --- a/Userland/Libraries/LibGUI/DragOperation.cpp +++ b/Userland/Libraries/LibGUI/DragOperation.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -20,10 +21,6 @@ DragOperation::DragOperation(Core::Object* parent) { } -DragOperation::~DragOperation() -{ -} - DragOperation::Outcome DragOperation::exec() { VERIFY(!s_current_drag_operation); diff --git a/Userland/Libraries/LibGUI/DragOperation.h b/Userland/Libraries/LibGUI/DragOperation.h index 7b9107c577..647e728d7c 100644 --- a/Userland/Libraries/LibGUI/DragOperation.h +++ b/Userland/Libraries/LibGUI/DragOperation.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -23,7 +24,7 @@ public: Cancelled, }; - virtual ~DragOperation() override; + virtual ~DragOperation() override = default; void set_mime_data(RefPtr<Core::MimeData> mime_data) { m_mime_data = move(mime_data); } void set_text(const String& text); diff --git a/Userland/Libraries/LibGUI/EditingEngine.cpp b/Userland/Libraries/LibGUI/EditingEngine.cpp index 9a4526f441..0141ffee11 100644 --- a/Userland/Libraries/LibGUI/EditingEngine.cpp +++ b/Userland/Libraries/LibGUI/EditingEngine.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, the SerenityOS developers. + * Copyright (c) 2021-2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -21,10 +21,6 @@ constexpr bool is_vim_punctuation(u32 code_point) return is_ascii_punctuation(code_point) && code_point != '_'; } -EditingEngine::~EditingEngine() -{ -} - void EditingEngine::attach(TextEditor& editor) { VERIFY(!m_editor); diff --git a/Userland/Libraries/LibGUI/EditingEngine.h b/Userland/Libraries/LibGUI/EditingEngine.h index a7588191b7..3b0e617cc7 100644 --- a/Userland/Libraries/LibGUI/EditingEngine.h +++ b/Userland/Libraries/LibGUI/EditingEngine.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, the SerenityOS developers. + * Copyright (c) 2021-2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -27,7 +27,7 @@ class EditingEngine { AK_MAKE_NONMOVABLE(EditingEngine); public: - virtual ~EditingEngine(); + virtual ~EditingEngine() = default; virtual CursorWidth cursor_width() const { return NARROW; } @@ -46,7 +46,7 @@ public: bool is_vim() const { return engine_type() == EngineType::Vim; } protected: - EditingEngine() { } + EditingEngine() = default; WeakPtr<TextEditor> m_editor; diff --git a/Userland/Libraries/LibGUI/Event.cpp b/Userland/Libraries/LibGUI/Event.cpp index 7cc272becd..414e21576d 100644 --- a/Userland/Libraries/LibGUI/Event.cpp +++ b/Userland/Libraries/LibGUI/Event.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -19,10 +20,6 @@ DropEvent::DropEvent(const Gfx::IntPoint& position, const String& text, NonnullR { } -DropEvent::~DropEvent() -{ -} - String KeyEvent::to_string() const { Vector<String, 8> parts; @@ -56,8 +53,4 @@ ActionEvent::ActionEvent(Type type, Action& action) { } -ActionEvent::~ActionEvent() -{ -} - } diff --git a/Userland/Libraries/LibGUI/Event.h b/Userland/Libraries/LibGUI/Event.h index 20340ec04e..d3018b2dfa 100644 --- a/Userland/Libraries/LibGUI/Event.h +++ b/Userland/Libraries/LibGUI/Event.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -72,12 +73,12 @@ public: __End_WM_Events, }; - Event() { } + Event() = default; explicit Event(Type type) : Core::Event(type) { } - virtual ~Event() { } + virtual ~Event() = default; bool is_key_event() const { return type() == KeyUp || type() == KeyDown; } bool is_paint_event() const { return type() == Paint; } @@ -454,7 +455,7 @@ class DropEvent final : public Event { public: DropEvent(const Gfx::IntPoint&, const String& text, NonnullRefPtr<Core::MimeData> mime_data); - ~DropEvent(); + ~DropEvent() = default; const Gfx::IntPoint& position() const { return m_position; } const String& text() const { return m_text; } @@ -530,7 +531,7 @@ private: class ActionEvent final : public Event { public: ActionEvent(Type, Action&); - ~ActionEvent(); + ~ActionEvent() = default; Action const& action() const { return *m_action; } Action& action() { return *m_action; } diff --git a/Userland/Libraries/LibGUI/FileSystemModel.cpp b/Userland/Libraries/LibGUI/FileSystemModel.cpp index 89840db8b2..1bf7fbcc04 100644 --- a/Userland/Libraries/LibGUI/FileSystemModel.cpp +++ b/Userland/Libraries/LibGUI/FileSystemModel.cpp @@ -1,6 +1,7 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> * Copyright (c) 2021, sin-ack <sin-ack@protonmail.com> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -271,10 +272,6 @@ FileSystemModel::FileSystemModel(String root_path, Mode mode) invalidate(); } -FileSystemModel::~FileSystemModel() -{ -} - String FileSystemModel::name_for_uid(uid_t uid) const { auto it = m_user_names.find(uid); diff --git a/Userland/Libraries/LibGUI/FileSystemModel.h b/Userland/Libraries/LibGUI/FileSystemModel.h index 4eede5e947..6fd6c9baf4 100644 --- a/Userland/Libraries/LibGUI/FileSystemModel.h +++ b/Userland/Libraries/LibGUI/FileSystemModel.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -43,7 +44,7 @@ public: }; struct Node { - ~Node() { } + ~Node() = default; String name; String symlink_target; @@ -102,7 +103,7 @@ public: { return adopt_ref(*new FileSystemModel(root_path, mode)); } - virtual ~FileSystemModel() override; + virtual ~FileSystemModel() override = default; String root_path() const { return m_root_path; } void set_root_path(String); diff --git a/Userland/Libraries/LibGUI/FontPicker.cpp b/Userland/Libraries/LibGUI/FontPicker.cpp index 98f231076d..6def60e8f4 100644 --- a/Userland/Libraries/LibGUI/FontPicker.cpp +++ b/Userland/Libraries/LibGUI/FontPicker.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -169,10 +170,6 @@ FontPicker::FontPicker(Window* parent_window, const Gfx::Font* current_font, boo set_font(current_font); } -FontPicker::~FontPicker() -{ -} - void FontPicker::set_font(const Gfx::Font* font) { if (m_font == font) diff --git a/Userland/Libraries/LibGUI/FontPicker.h b/Userland/Libraries/LibGUI/FontPicker.h index 087f0a469e..a40a28f168 100644 --- a/Userland/Libraries/LibGUI/FontPicker.h +++ b/Userland/Libraries/LibGUI/FontPicker.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -16,7 +17,7 @@ class FontPicker final : public GUI::Dialog { C_OBJECT(FontPicker); public: - virtual ~FontPicker() override; + virtual ~FontPicker() override = default; RefPtr<Gfx::Font> font() const { return m_font; } void set_font(const Gfx::Font*); diff --git a/Userland/Libraries/LibGUI/Frame.cpp b/Userland/Libraries/LibGUI/Frame.cpp index d82bf4d7fe..cf5d676fbe 100644 --- a/Userland/Libraries/LibGUI/Frame.cpp +++ b/Userland/Libraries/LibGUI/Frame.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -32,10 +33,6 @@ Frame::Frame() { Gfx::FrameShape::Window, "Window" }); } -Frame::~Frame() -{ -} - void Frame::set_frame_thickness(int thickness) { if (m_thickness == thickness) diff --git a/Userland/Libraries/LibGUI/Frame.h b/Userland/Libraries/LibGUI/Frame.h index 321d920d10..5bd7ead299 100644 --- a/Userland/Libraries/LibGUI/Frame.h +++ b/Userland/Libraries/LibGUI/Frame.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -14,7 +15,7 @@ namespace GUI { class Frame : public Widget { C_OBJECT(Frame) public: - virtual ~Frame() override; + virtual ~Frame() override = default; int frame_thickness() const { return m_thickness; } void set_frame_thickness(int thickness); diff --git a/Userland/Libraries/LibGUI/GML/AutocompleteProvider.h b/Userland/Libraries/LibGUI/GML/AutocompleteProvider.h index 98dfe35a07..f3008b8517 100644 --- a/Userland/Libraries/LibGUI/GML/AutocompleteProvider.h +++ b/Userland/Libraries/LibGUI/GML/AutocompleteProvider.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -12,8 +13,8 @@ namespace GUI::GML { class AutocompleteProvider final : public virtual GUI::AutocompleteProvider { public: - AutocompleteProvider() { } - virtual ~AutocompleteProvider() override { } + AutocompleteProvider() = default; + virtual ~AutocompleteProvider() override = default; private: static bool can_have_declared_layout(StringView class_name) diff --git a/Userland/Libraries/LibGUI/GML/SyntaxHighlighter.cpp b/Userland/Libraries/LibGUI/GML/SyntaxHighlighter.cpp index 4a6e3f3344..41c9de0446 100644 --- a/Userland/Libraries/LibGUI/GML/SyntaxHighlighter.cpp +++ b/Userland/Libraries/LibGUI/GML/SyntaxHighlighter.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -77,8 +78,4 @@ bool SyntaxHighlighter::token_types_equal(u64 token1, u64 token2) const return static_cast<Token::Type>(token1) == static_cast<Token::Type>(token2); } -SyntaxHighlighter::~SyntaxHighlighter() -{ -} - } diff --git a/Userland/Libraries/LibGUI/GML/SyntaxHighlighter.h b/Userland/Libraries/LibGUI/GML/SyntaxHighlighter.h index 5b52bdacf2..0c2961e90a 100644 --- a/Userland/Libraries/LibGUI/GML/SyntaxHighlighter.h +++ b/Userland/Libraries/LibGUI/GML/SyntaxHighlighter.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -12,8 +13,8 @@ namespace GUI::GML { class SyntaxHighlighter final : public Syntax::Highlighter { public: - SyntaxHighlighter() { } - virtual ~SyntaxHighlighter() override; + SyntaxHighlighter() = default; + virtual ~SyntaxHighlighter() override = default; virtual bool is_identifier(u64) const override; diff --git a/Userland/Libraries/LibGUI/GitCommitSyntaxHighlighter.cpp b/Userland/Libraries/LibGUI/GitCommitSyntaxHighlighter.cpp index dbceb07550..abc597861c 100644 --- a/Userland/Libraries/LibGUI/GitCommitSyntaxHighlighter.cpp +++ b/Userland/Libraries/LibGUI/GitCommitSyntaxHighlighter.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2022, Brian Gianforcaro <bgianf@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -52,8 +53,4 @@ bool GitCommitSyntaxHighlighter::token_types_equal(u64 token1, u64 token2) const return static_cast<GUI::GitCommitToken::Type>(token1) == static_cast<GUI::GitCommitToken::Type>(token2); } -GitCommitSyntaxHighlighter::~GitCommitSyntaxHighlighter() -{ -} - } diff --git a/Userland/Libraries/LibGUI/GitCommitSyntaxHighlighter.h b/Userland/Libraries/LibGUI/GitCommitSyntaxHighlighter.h index 3e9cec60a7..1153e8b9a9 100644 --- a/Userland/Libraries/LibGUI/GitCommitSyntaxHighlighter.h +++ b/Userland/Libraries/LibGUI/GitCommitSyntaxHighlighter.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2022, Brian Gianforcaro <bgianf@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -12,8 +13,8 @@ namespace GUI { class GitCommitSyntaxHighlighter final : public Syntax::Highlighter { public: - GitCommitSyntaxHighlighter() { } - virtual ~GitCommitSyntaxHighlighter() override; + GitCommitSyntaxHighlighter() = default; + virtual ~GitCommitSyntaxHighlighter() override = default; virtual Syntax::Language language() const override { return Syntax::Language::GitCommit; } virtual void rehighlight(Palette const&) override; diff --git a/Userland/Libraries/LibGUI/GlyphMapWidget.cpp b/Userland/Libraries/LibGUI/GlyphMapWidget.cpp index a023d2301e..ec15920ae0 100644 --- a/Userland/Libraries/LibGUI/GlyphMapWidget.cpp +++ b/Userland/Libraries/LibGUI/GlyphMapWidget.cpp @@ -2,6 +2,7 @@ * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> * Copyright (c) 2021, Mustafa Quraish <mustafa@serenityos.org> * Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -55,10 +56,6 @@ GlyphMapWidget::GlyphMapWidget() set_active_glyph('A'); } -GlyphMapWidget::~GlyphMapWidget() -{ -} - void GlyphMapWidget::resize_event(ResizeEvent& event) { recalculate_content_size(); diff --git a/Userland/Libraries/LibGUI/GlyphMapWidget.h b/Userland/Libraries/LibGUI/GlyphMapWidget.h index f2295d95fe..7fc07e1f50 100644 --- a/Userland/Libraries/LibGUI/GlyphMapWidget.h +++ b/Userland/Libraries/LibGUI/GlyphMapWidget.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> * Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -17,7 +18,7 @@ namespace GUI { class GlyphMapWidget final : public AbstractScrollableWidget { C_OBJECT(GlyphMapWidget) public: - virtual ~GlyphMapWidget() override; + virtual ~GlyphMapWidget() override = default; class Selection { public: diff --git a/Userland/Libraries/LibGUI/GroupBox.cpp b/Userland/Libraries/LibGUI/GroupBox.cpp index f0f4a853ff..2b410e1c69 100644 --- a/Userland/Libraries/LibGUI/GroupBox.cpp +++ b/Userland/Libraries/LibGUI/GroupBox.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -20,10 +21,6 @@ GroupBox::GroupBox(StringView title) REGISTER_STRING_PROPERTY("title", title, set_title); } -GroupBox::~GroupBox() -{ -} - Margins GroupBox::content_margins() const { return { diff --git a/Userland/Libraries/LibGUI/GroupBox.h b/Userland/Libraries/LibGUI/GroupBox.h index a928bd8789..0513a7ed11 100644 --- a/Userland/Libraries/LibGUI/GroupBox.h +++ b/Userland/Libraries/LibGUI/GroupBox.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -13,7 +14,7 @@ namespace GUI { class GroupBox : public Widget { C_OBJECT(GroupBox) public: - virtual ~GroupBox() override; + virtual ~GroupBox() override = default; String title() const { return m_title; } void set_title(StringView); diff --git a/Userland/Libraries/LibGUI/HeaderView.cpp b/Userland/Libraries/LibGUI/HeaderView.cpp index 14f40f84a0..0eacc7e284 100644 --- a/Userland/Libraries/LibGUI/HeaderView.cpp +++ b/Userland/Libraries/LibGUI/HeaderView.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -30,10 +31,6 @@ HeaderView::HeaderView(AbstractTableView& table_view, Gfx::Orientation orientati } } -HeaderView::~HeaderView() -{ -} - void HeaderView::set_section_size(int section, int size) { auto& data = section_data(section); diff --git a/Userland/Libraries/LibGUI/HeaderView.h b/Userland/Libraries/LibGUI/HeaderView.h index 2010d5d1f4..89c98ede6d 100644 --- a/Userland/Libraries/LibGUI/HeaderView.h +++ b/Userland/Libraries/LibGUI/HeaderView.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -15,7 +16,7 @@ class HeaderView final : public Widget { C_OBJECT(HeaderView); public: - virtual ~HeaderView() override; + virtual ~HeaderView() override = default; Gfx::Orientation orientation() const { return m_orientation; } diff --git a/Userland/Libraries/LibGUI/INISyntaxHighlighter.cpp b/Userland/Libraries/LibGUI/INISyntaxHighlighter.cpp index 71941d4557..0dd2c2d949 100644 --- a/Userland/Libraries/LibGUI/INISyntaxHighlighter.cpp +++ b/Userland/Libraries/LibGUI/INISyntaxHighlighter.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Hüseyin Aslıtürk <asliturk@hotmail.com> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -76,8 +77,4 @@ bool IniSyntaxHighlighter::token_types_equal(u64 token1, u64 token2) const return static_cast<GUI::IniToken::Type>(token1) == static_cast<GUI::IniToken::Type>(token2); } -IniSyntaxHighlighter::~IniSyntaxHighlighter() -{ -} - } diff --git a/Userland/Libraries/LibGUI/INISyntaxHighlighter.h b/Userland/Libraries/LibGUI/INISyntaxHighlighter.h index 5e23da25e8..bb56a79071 100644 --- a/Userland/Libraries/LibGUI/INISyntaxHighlighter.h +++ b/Userland/Libraries/LibGUI/INISyntaxHighlighter.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Hüseyin Aslıtürk <asliturk@hotmail.com> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -12,8 +13,8 @@ namespace GUI { class IniSyntaxHighlighter final : public Syntax::Highlighter { public: - IniSyntaxHighlighter() { } - virtual ~IniSyntaxHighlighter() override; + IniSyntaxHighlighter() = default; + virtual ~IniSyntaxHighlighter() override = default; virtual bool is_identifier(u64) const override; diff --git a/Userland/Libraries/LibGUI/Icon.h b/Userland/Libraries/LibGUI/Icon.h index 4be214b91d..a8592082d5 100644 --- a/Userland/Libraries/LibGUI/Icon.h +++ b/Userland/Libraries/LibGUI/Icon.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> * Copyright (c) 2021, Julius Heijmen <julius.heijmen@gmail.com> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -17,7 +18,7 @@ namespace GUI { class IconImpl : public RefCounted<IconImpl> { public: static NonnullRefPtr<IconImpl> create() { return adopt_ref(*new IconImpl); } - ~IconImpl() { } + ~IconImpl() = default; const Gfx::Bitmap* bitmap_for_size(int) const; void set_bitmap_for_size(int, RefPtr<Gfx::Bitmap>&&); @@ -31,7 +32,7 @@ public: } private: - IconImpl() { } + IconImpl() = default; HashMap<int, RefPtr<Gfx::Bitmap>> m_bitmaps; }; @@ -42,7 +43,7 @@ public: explicit Icon(RefPtr<Gfx::Bitmap>&&, RefPtr<Gfx::Bitmap>&&); explicit Icon(const IconImpl&); Icon(const Icon&); - ~Icon() { } + ~Icon() = default; static Icon default_icon(StringView); static ErrorOr<Icon> try_create_default_icon(StringView); diff --git a/Userland/Libraries/LibGUI/IconView.cpp b/Userland/Libraries/LibGUI/IconView.cpp index 2e99e6bbd6..1d6717d210 100644 --- a/Userland/Libraries/LibGUI/IconView.cpp +++ b/Userland/Libraries/LibGUI/IconView.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -26,10 +27,6 @@ IconView::IconView() horizontal_scrollbar().set_visible(false); } -IconView::~IconView() -{ -} - void IconView::select_all() { for (int item_index = 0; item_index < item_count(); ++item_index) { diff --git a/Userland/Libraries/LibGUI/IconView.h b/Userland/Libraries/LibGUI/IconView.h index 1b97b91dc6..787d21cb1a 100644 --- a/Userland/Libraries/LibGUI/IconView.h +++ b/Userland/Libraries/LibGUI/IconView.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -16,7 +17,7 @@ namespace GUI { class IconView : public AbstractView { C_OBJECT(IconView) public: - virtual ~IconView() override; + virtual ~IconView() override = default; enum class FlowDirection { LeftToRight, diff --git a/Userland/Libraries/LibGUI/ImageWidget.cpp b/Userland/Libraries/LibGUI/ImageWidget.cpp index b28ee605a2..c59620db91 100644 --- a/Userland/Libraries/LibGUI/ImageWidget.cpp +++ b/Userland/Libraries/LibGUI/ImageWidget.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Hüseyin Aslıtürk <asliturk@hotmail.com> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -27,10 +28,6 @@ ImageWidget::ImageWidget(StringView) REGISTER_BOOL_PROPERTY("should_stretch", should_stretch, set_should_stretch); } -ImageWidget::~ImageWidget() -{ -} - void ImageWidget::set_bitmap(const Gfx::Bitmap* bitmap) { if (m_bitmap == bitmap) diff --git a/Userland/Libraries/LibGUI/ImageWidget.h b/Userland/Libraries/LibGUI/ImageWidget.h index 6cee2aab41..e0fb19838d 100644 --- a/Userland/Libraries/LibGUI/ImageWidget.h +++ b/Userland/Libraries/LibGUI/ImageWidget.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Hüseyin Aslıtürk <asliturk@hotmail.com> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -8,13 +9,14 @@ #include <LibCore/Timer.h> #include <LibGUI/Frame.h> +#include <LibGfx/ImageDecoder.h> namespace GUI { class ImageWidget : public Frame { C_OBJECT(ImageWidget) public: - virtual ~ImageWidget() override; + virtual ~ImageWidget() override = default; void set_bitmap(const Gfx::Bitmap*); Gfx::Bitmap* bitmap() { return m_bitmap.ptr(); } diff --git a/Userland/Libraries/LibGUI/InputBox.cpp b/Userland/Libraries/LibGUI/InputBox.cpp index ebec5d88be..1be35696fb 100644 --- a/Userland/Libraries/LibGUI/InputBox.cpp +++ b/Userland/Libraries/LibGUI/InputBox.cpp @@ -1,6 +1,7 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> * Copyright (c) 2021, Jakob-Niklas See <git@nwex.de> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -24,10 +25,6 @@ InputBox::InputBox(Window* parent_window, String& text_value, StringView prompt, build(input_type); } -InputBox::~InputBox() -{ -} - int InputBox::show(Window* parent_window, String& text_value, StringView prompt, StringView title, StringView placeholder, InputType input_type) { auto box = InputBox::construct(parent_window, text_value, prompt, title, placeholder, input_type); diff --git a/Userland/Libraries/LibGUI/InputBox.h b/Userland/Libraries/LibGUI/InputBox.h index 60705ad21c..16593ed91c 100644 --- a/Userland/Libraries/LibGUI/InputBox.h +++ b/Userland/Libraries/LibGUI/InputBox.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> * Copyright (c) 2021, Jakob-Niklas See <git@nwex.de> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -19,7 +20,7 @@ enum class InputType { class InputBox : public Dialog { C_OBJECT(InputBox) public: - virtual ~InputBox() override; + virtual ~InputBox() override = default; static int show(Window* parent_window, String& text_value, StringView prompt, StringView title, StringView placeholder = {}, InputType input_type = InputType::Text); diff --git a/Userland/Libraries/LibGUI/ItemListModel.h b/Userland/Libraries/LibGUI/ItemListModel.h index 5703e69179..68a9e26a0f 100644 --- a/Userland/Libraries/LibGUI/ItemListModel.h +++ b/Userland/Libraries/LibGUI/ItemListModel.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2019-2020, Jesse Buhgaiar <jooster669@gmail.com> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -34,7 +35,7 @@ public: return adopt_ref(*new ItemListModel<T, Container>(data, row_count)); } - virtual ~ItemListModel() override { } + virtual ~ItemListModel() override = default; virtual int row_count(ModelIndex const& index) const override { diff --git a/Userland/Libraries/LibGUI/JsonArrayModel.h b/Userland/Libraries/LibGUI/JsonArrayModel.h index faec864f26..fcdb4ecfd3 100644 --- a/Userland/Libraries/LibGUI/JsonArrayModel.h +++ b/Userland/Libraries/LibGUI/JsonArrayModel.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -44,7 +45,7 @@ public: return adopt_ref(*new JsonArrayModel(json_path, move(fields))); } - virtual ~JsonArrayModel() override { } + virtual ~JsonArrayModel() override = default; virtual int row_count(const ModelIndex& = ModelIndex()) const override { return m_array.size(); } virtual int column_count(const ModelIndex& = ModelIndex()) const override { return m_fields.size(); } diff --git a/Userland/Libraries/LibGUI/Label.cpp b/Userland/Libraries/LibGUI/Label.cpp index e7a0ee254d..8745611ed2 100644 --- a/Userland/Libraries/LibGUI/Label.cpp +++ b/Userland/Libraries/LibGUI/Label.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -33,10 +34,6 @@ Label::Label(String text) REGISTER_STRING_PROPERTY("icon", icon, set_icon_from_path); } -Label::~Label() -{ -} - void Label::set_autosize(bool autosize) { if (m_autosize == autosize) diff --git a/Userland/Libraries/LibGUI/Label.h b/Userland/Libraries/LibGUI/Label.h index 4d889996a3..97e4493ddc 100644 --- a/Userland/Libraries/LibGUI/Label.h +++ b/Userland/Libraries/LibGUI/Label.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -16,7 +17,7 @@ class Label : public Frame { C_OBJECT(Label); public: - virtual ~Label() override; + virtual ~Label() override = default; String text() const { return m_text; } void set_text(String); diff --git a/Userland/Libraries/LibGUI/Layout.cpp b/Userland/Libraries/LibGUI/Layout.cpp index 76818bbb63..3c54efda78 100644 --- a/Userland/Libraries/LibGUI/Layout.cpp +++ b/Userland/Libraries/LibGUI/Layout.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -37,9 +38,7 @@ Layout::Layout() }); } -Layout::~Layout() -{ -} +Layout::~Layout() = default; void Layout::notify_adopted(Badge<Widget>, Widget& widget) { diff --git a/Userland/Libraries/LibGUI/LazyWidget.cpp b/Userland/Libraries/LibGUI/LazyWidget.cpp index 82dd594688..6756cc4695 100644 --- a/Userland/Libraries/LibGUI/LazyWidget.cpp +++ b/Userland/Libraries/LibGUI/LazyWidget.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -8,14 +9,6 @@ namespace GUI { -LazyWidget::LazyWidget() -{ -} - -LazyWidget::~LazyWidget() -{ -} - void LazyWidget::show_event(ShowEvent&) { if (m_has_been_shown) diff --git a/Userland/Libraries/LibGUI/LazyWidget.h b/Userland/Libraries/LibGUI/LazyWidget.h index 7011b14b67..9e8f985b12 100644 --- a/Userland/Libraries/LibGUI/LazyWidget.h +++ b/Userland/Libraries/LibGUI/LazyWidget.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -13,12 +14,12 @@ namespace GUI { class LazyWidget : public Widget { C_OBJECT(LazyWidget) public: - virtual ~LazyWidget() override; + virtual ~LazyWidget() override = default; Function<void(LazyWidget&)> on_first_show; protected: - LazyWidget(); + LazyWidget() = default; private: virtual void show_event(ShowEvent&) override; diff --git a/Userland/Libraries/LibGUI/ListView.cpp b/Userland/Libraries/LibGUI/ListView.cpp index 6fbdd8bc34..fecd4b8d80 100644 --- a/Userland/Libraries/LibGUI/ListView.cpp +++ b/Userland/Libraries/LibGUI/ListView.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -22,9 +23,7 @@ ListView::ListView() set_searchable(true); } -ListView::~ListView() -{ -} +ListView::~ListView() = default; void ListView::select_all() { diff --git a/Userland/Libraries/LibGUI/Menubar.cpp b/Userland/Libraries/LibGUI/Menubar.cpp index 69fdb27f13..587dd229c8 100644 --- a/Userland/Libraries/LibGUI/Menubar.cpp +++ b/Userland/Libraries/LibGUI/Menubar.cpp @@ -1,6 +1,7 @@ /* * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org> * Copyright (c) 2021, sin-ack <sin-ack@protonmail.com> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -9,14 +10,6 @@ namespace GUI { -Menubar::Menubar() -{ -} - -Menubar::~Menubar() -{ -} - ErrorOr<NonnullRefPtr<Menu>> Menubar::try_add_menu(Badge<Window>, String name) { auto menu = TRY(try_add<Menu>(move(name))); diff --git a/Userland/Libraries/LibGUI/Menubar.h b/Userland/Libraries/LibGUI/Menubar.h index 71e1b35416..884c5b475a 100644 --- a/Userland/Libraries/LibGUI/Menubar.h +++ b/Userland/Libraries/LibGUI/Menubar.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org> * Copyright (c) 2021, sin-ack <sin-ack@protonmail.com> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -20,7 +21,7 @@ class Menubar : public Core::Object { C_OBJECT(Menubar); public: - virtual ~Menubar() override; + virtual ~Menubar() override = default; ErrorOr<NonnullRefPtr<Menu>> try_add_menu(Badge<Window>, String name); Menu& add_menu(Badge<Window>, String name); @@ -28,7 +29,7 @@ public: void for_each_menu(Function<IterationDecision(Menu&)>); private: - Menubar(); + Menubar() = default; NonnullRefPtrVector<Menu> m_menus; }; diff --git a/Userland/Libraries/LibGUI/MessageBox.cpp b/Userland/Libraries/LibGUI/MessageBox.cpp index b282430435..bc2c67fda2 100644 --- a/Userland/Libraries/LibGUI/MessageBox.cpp +++ b/Userland/Libraries/LibGUI/MessageBox.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -71,10 +72,6 @@ MessageBox::MessageBox(Window* parent_window, StringView text, StringView title, build(); } -MessageBox::~MessageBox() -{ -} - RefPtr<Gfx::Bitmap> MessageBox::icon() const { switch (m_type) { diff --git a/Userland/Libraries/LibGUI/MessageBox.h b/Userland/Libraries/LibGUI/MessageBox.h index 98265ca8ed..12d8ae72e0 100644 --- a/Userland/Libraries/LibGUI/MessageBox.h +++ b/Userland/Libraries/LibGUI/MessageBox.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -29,7 +30,7 @@ public: YesNoCancel, }; - virtual ~MessageBox() override; + virtual ~MessageBox() override = default; static int show(Window* parent_window, StringView text, StringView title, Type type = Type::None, InputType input_type = InputType::OK); static int show_error(Window* parent_window, StringView text); diff --git a/Userland/Libraries/LibGUI/Model.cpp b/Userland/Libraries/LibGUI/Model.cpp index 8989751144..7ffa5c1fc4 100644 --- a/Userland/Libraries/LibGUI/Model.cpp +++ b/Userland/Libraries/LibGUI/Model.cpp @@ -1,6 +1,7 @@ /* * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org> * Copyright (c) 2021, sin-ack <sin-ack@protonmail.com> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -11,13 +12,9 @@ namespace GUI { -Model::Model() -{ -} +Model::Model() = default; -Model::~Model() -{ -} +Model::~Model() = default; void Model::register_view(Badge<AbstractView>, AbstractView& view) { diff --git a/Userland/Libraries/LibGUI/Model.h b/Userland/Libraries/LibGUI/Model.h index 498cea4dbe..a710ff2c15 100644 --- a/Userland/Libraries/LibGUI/Model.h +++ b/Userland/Libraries/LibGUI/Model.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> * Copyright (c) 2021, sin-ack <sin-ack@protonmail.com> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -33,7 +34,7 @@ enum class SortOrder { class ModelClient { public: - virtual ~ModelClient() { } + virtual ~ModelClient() = default; virtual void model_did_update(unsigned flags) = 0; diff --git a/Userland/Libraries/LibGUI/ModelEditingDelegate.h b/Userland/Libraries/LibGUI/ModelEditingDelegate.h index faf11d276a..e02a61efaa 100644 --- a/Userland/Libraries/LibGUI/ModelEditingDelegate.h +++ b/Userland/Libraries/LibGUI/ModelEditingDelegate.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -19,7 +20,7 @@ public: SelectAll, }; - virtual ~ModelEditingDelegate() { } + virtual ~ModelEditingDelegate() = default; void bind(Model& model, const ModelIndex& index) { @@ -43,7 +44,7 @@ public: virtual void will_begin_editing() { } protected: - ModelEditingDelegate() { } + ModelEditingDelegate() = default; virtual RefPtr<Widget> create_widget() = 0; void commit() @@ -72,8 +73,8 @@ private: class StringModelEditingDelegate : public ModelEditingDelegate { public: - StringModelEditingDelegate() { } - virtual ~StringModelEditingDelegate() override { } + StringModelEditingDelegate() = default; + virtual ~StringModelEditingDelegate() override = default; virtual RefPtr<Widget> create_widget() override { diff --git a/Userland/Libraries/LibGUI/MultiView.cpp b/Userland/Libraries/LibGUI/MultiView.cpp index 86b1f32ef8..fff6f0e135 100644 --- a/Userland/Libraries/LibGUI/MultiView.cpp +++ b/Userland/Libraries/LibGUI/MultiView.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -49,10 +50,6 @@ MultiView::MultiView() set_view_mode(ViewMode::Icon); } -MultiView::~MultiView() -{ -} - void MultiView::set_view_mode(ViewMode mode) { if (m_view_mode == mode) diff --git a/Userland/Libraries/LibGUI/MultiView.h b/Userland/Libraries/LibGUI/MultiView.h index 3a0ba38a4f..a4436fe08d 100644 --- a/Userland/Libraries/LibGUI/MultiView.h +++ b/Userland/Libraries/LibGUI/MultiView.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -17,7 +18,7 @@ namespace GUI { class MultiView final : public GUI::StackWidget { C_OBJECT(MultiView) public: - virtual ~MultiView() override; + virtual ~MultiView() override = default; void refresh(); diff --git a/Userland/Libraries/LibGUI/Notification.cpp b/Userland/Libraries/LibGUI/Notification.cpp index 3d15afbc3d..04e4a5aed0 100644 --- a/Userland/Libraries/LibGUI/Notification.cpp +++ b/Userland/Libraries/LibGUI/Notification.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -33,13 +34,8 @@ private: Notification* m_notification; }; -Notification::Notification() -{ -} - -Notification::~Notification() -{ -} +Notification::Notification() = default; +Notification::~Notification() = default; void Notification::show() { diff --git a/Userland/Libraries/LibGUI/OpacitySlider.cpp b/Userland/Libraries/LibGUI/OpacitySlider.cpp index be578c0f0e..59cb22d2fa 100644 --- a/Userland/Libraries/LibGUI/OpacitySlider.cpp +++ b/Userland/Libraries/LibGUI/OpacitySlider.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -25,10 +26,6 @@ OpacitySlider::OpacitySlider(Gfx::Orientation orientation) set_fixed_height(20); } -OpacitySlider::~OpacitySlider() -{ -} - Gfx::IntRect OpacitySlider::frame_inner_rect() const { return rect().shrunken(4, 4); diff --git a/Userland/Libraries/LibGUI/OpacitySlider.h b/Userland/Libraries/LibGUI/OpacitySlider.h index 7bc5e9beee..e4ab0560be 100644 --- a/Userland/Libraries/LibGUI/OpacitySlider.h +++ b/Userland/Libraries/LibGUI/OpacitySlider.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -14,7 +15,7 @@ class OpacitySlider : public AbstractSlider { C_OBJECT(OpacitySlider); public: - virtual ~OpacitySlider() override; + virtual ~OpacitySlider() override = default; protected: virtual void paint_event(PaintEvent&) override; diff --git a/Userland/Libraries/LibGUI/PasswordInputDialog.cpp b/Userland/Libraries/LibGUI/PasswordInputDialog.cpp index 92b8b4249f..37731d27bc 100644 --- a/Userland/Libraries/LibGUI/PasswordInputDialog.cpp +++ b/Userland/Libraries/LibGUI/PasswordInputDialog.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -59,10 +60,6 @@ PasswordInputDialog::PasswordInputDialog(Window* parent_window, String title, St password_box.set_focus(true); } -PasswordInputDialog::~PasswordInputDialog() -{ -} - int PasswordInputDialog::show(Window* parent_window, String& text_value, String title, String server, String username) { auto box = PasswordInputDialog::construct(parent_window, move(title), move(server), move(username)); diff --git a/Userland/Libraries/LibGUI/PasswordInputDialog.h b/Userland/Libraries/LibGUI/PasswordInputDialog.h index db0d05d936..ee3200d792 100644 --- a/Userland/Libraries/LibGUI/PasswordInputDialog.h +++ b/Userland/Libraries/LibGUI/PasswordInputDialog.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -14,7 +15,7 @@ class PasswordInputDialog : public Dialog { C_OBJECT(PasswordInputDialog); public: - virtual ~PasswordInputDialog() override; + virtual ~PasswordInputDialog() override = default; static int show(Window* parent_window, String& text_value, String title, String server, String username); diff --git a/Userland/Libraries/LibGUI/PersistentModelIndex.h b/Userland/Libraries/LibGUI/PersistentModelIndex.h index 4efa882642..c3a56e77ba 100644 --- a/Userland/Libraries/LibGUI/PersistentModelIndex.h +++ b/Userland/Libraries/LibGUI/PersistentModelIndex.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2021, sin-ack <sin-ack@protonmail.com> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -30,7 +31,7 @@ class PersistentHandle : public Weakable<PersistentHandle> { class PersistentModelIndex { public: - PersistentModelIndex() { } + PersistentModelIndex() = default; PersistentModelIndex(ModelIndex const&); PersistentModelIndex(PersistentModelIndex const&) = default; PersistentModelIndex(PersistentModelIndex&&) = default; diff --git a/Userland/Libraries/LibGUI/ProcessChooser.cpp b/Userland/Libraries/LibGUI/ProcessChooser.cpp index 35ef3a4e2a..94c3e4781d 100644 --- a/Userland/Libraries/LibGUI/ProcessChooser.cpp +++ b/Userland/Libraries/LibGUI/ProcessChooser.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -104,8 +105,4 @@ void ProcessChooser::set_pid_from_index_and_close(const ModelIndex& index) done(ExecOK); } -ProcessChooser::~ProcessChooser() -{ -} - } diff --git a/Userland/Libraries/LibGUI/ProcessChooser.h b/Userland/Libraries/LibGUI/ProcessChooser.h index 983abb3f65..23e3363a0e 100644 --- a/Userland/Libraries/LibGUI/ProcessChooser.h +++ b/Userland/Libraries/LibGUI/ProcessChooser.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -16,7 +17,7 @@ class ProcessChooser final : public GUI::Dialog { C_OBJECT(ProcessChooser); public: - virtual ~ProcessChooser() override; + virtual ~ProcessChooser() override = default; pid_t pid() const { return m_pid; } diff --git a/Userland/Libraries/LibGUI/Progressbar.cpp b/Userland/Libraries/LibGUI/Progressbar.cpp index dcdd409142..f449487a4e 100644 --- a/Userland/Libraries/LibGUI/Progressbar.cpp +++ b/Userland/Libraries/LibGUI/Progressbar.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -28,10 +29,6 @@ Progressbar::Progressbar(Orientation orientation) REGISTER_INT_PROPERTY("max", max, set_max); } -Progressbar::~Progressbar() -{ -} - void Progressbar::set_value(int value) { if (m_value == value) diff --git a/Userland/Libraries/LibGUI/Progressbar.h b/Userland/Libraries/LibGUI/Progressbar.h index 59da0b9ff1..c3ff489f0f 100644 --- a/Userland/Libraries/LibGUI/Progressbar.h +++ b/Userland/Libraries/LibGUI/Progressbar.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -13,7 +14,7 @@ namespace GUI { class Progressbar : public Frame { C_OBJECT(Progressbar) public: - virtual ~Progressbar() override; + virtual ~Progressbar() override = default; void set_range(int min, int max); void set_min(int min) { set_range(min, max()); } @@ -56,7 +57,7 @@ class VerticalProgressbar final : public Progressbar { C_OBJECT(VerticalProgressbar); public: - virtual ~VerticalProgressbar() override { } + virtual ~VerticalProgressbar() override = default; private: VerticalProgressbar() @@ -69,7 +70,7 @@ class HorizontalProgressbar final : public Progressbar { C_OBJECT(HorizontalProgressbar); public: - virtual ~HorizontalProgressbar() override { } + virtual ~HorizontalProgressbar() override = default; private: HorizontalProgressbar() diff --git a/Userland/Libraries/LibGUI/RadioButton.cpp b/Userland/Libraries/LibGUI/RadioButton.cpp index 8784f9c333..5c051e86d8 100644 --- a/Userland/Libraries/LibGUI/RadioButton.cpp +++ b/Userland/Libraries/LibGUI/RadioButton.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -24,10 +25,6 @@ RadioButton::RadioButton(String text) set_fixed_height(22); } -RadioButton::~RadioButton() -{ -} - Gfx::IntSize RadioButton::circle_size() { return { 12, 12 }; diff --git a/Userland/Libraries/LibGUI/RadioButton.h b/Userland/Libraries/LibGUI/RadioButton.h index 0294056c9b..e2ef712bfd 100644 --- a/Userland/Libraries/LibGUI/RadioButton.h +++ b/Userland/Libraries/LibGUI/RadioButton.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -14,7 +15,7 @@ class RadioButton : public AbstractButton { C_OBJECT(RadioButton); public: - virtual ~RadioButton() override; + virtual ~RadioButton() override = default; virtual void click(unsigned modifiers = 0) override; diff --git a/Userland/Libraries/LibGUI/ResizeCorner.cpp b/Userland/Libraries/LibGUI/ResizeCorner.cpp index 82917c86be..072b486cae 100644 --- a/Userland/Libraries/LibGUI/ResizeCorner.cpp +++ b/Userland/Libraries/LibGUI/ResizeCorner.cpp @@ -61,10 +61,6 @@ ResizeCorner::ResizeCorner() set_fixed_size(16, 18); } -ResizeCorner::~ResizeCorner() -{ -} - void ResizeCorner::paint_event(PaintEvent& event) { Painter painter(*this); diff --git a/Userland/Libraries/LibGUI/ResizeCorner.h b/Userland/Libraries/LibGUI/ResizeCorner.h index 832774c243..633d362f3a 100644 --- a/Userland/Libraries/LibGUI/ResizeCorner.h +++ b/Userland/Libraries/LibGUI/ResizeCorner.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -13,7 +14,7 @@ namespace GUI { class ResizeCorner : public Widget { C_OBJECT(ResizeCorner) public: - virtual ~ResizeCorner() override; + virtual ~ResizeCorner() override = default; protected: ResizeCorner(); diff --git a/Userland/Libraries/LibGUI/RunningProcessesModel.cpp b/Userland/Libraries/LibGUI/RunningProcessesModel.cpp index d05391acaa..3869dd71c9 100644 --- a/Userland/Libraries/LibGUI/RunningProcessesModel.cpp +++ b/Userland/Libraries/LibGUI/RunningProcessesModel.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -15,14 +16,6 @@ NonnullRefPtr<RunningProcessesModel> RunningProcessesModel::create() return adopt_ref(*new RunningProcessesModel); } -RunningProcessesModel::RunningProcessesModel() -{ -} - -RunningProcessesModel::~RunningProcessesModel() -{ -} - void RunningProcessesModel::update() { m_processes.clear(); diff --git a/Userland/Libraries/LibGUI/RunningProcessesModel.h b/Userland/Libraries/LibGUI/RunningProcessesModel.h index f57017e818..f8a347ca62 100644 --- a/Userland/Libraries/LibGUI/RunningProcessesModel.h +++ b/Userland/Libraries/LibGUI/RunningProcessesModel.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -14,7 +15,7 @@ namespace GUI { class RunningProcessesModel final : public GUI::Model { public: static NonnullRefPtr<RunningProcessesModel> create(); - virtual ~RunningProcessesModel() override; + virtual ~RunningProcessesModel() override = default; enum Column { Icon, @@ -32,7 +33,7 @@ public: void update(); private: - RunningProcessesModel(); + RunningProcessesModel() = default; struct Process { pid_t pid; diff --git a/Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp b/Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp index e8020143d5..214ffe0401 100644 --- a/Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp +++ b/Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -18,10 +19,6 @@ ScrollableContainerWidget::ScrollableContainerWidget() REGISTER_BOOL_PROPERTY("should_hide_unnecessary_scrollbars", should_hide_unnecessary_scrollbars, set_should_hide_unnecessary_scrollbars); } -ScrollableContainerWidget::~ScrollableContainerWidget() -{ -} - void ScrollableContainerWidget::did_scroll() { AbstractScrollableWidget::did_scroll(); diff --git a/Userland/Libraries/LibGUI/ScrollableContainerWidget.h b/Userland/Libraries/LibGUI/ScrollableContainerWidget.h index 5fc3f8b0a5..36c2cd734c 100644 --- a/Userland/Libraries/LibGUI/ScrollableContainerWidget.h +++ b/Userland/Libraries/LibGUI/ScrollableContainerWidget.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -14,7 +15,7 @@ class ScrollableContainerWidget : public GUI::AbstractScrollableWidget { C_OBJECT(ScrollableContainerWidget); public: - virtual ~ScrollableContainerWidget(); + virtual ~ScrollableContainerWidget() = default; void set_widget(GUI::Widget*); GUI::Widget* widget() { return m_widget; } diff --git a/Userland/Libraries/LibGUI/Scrollbar.cpp b/Userland/Libraries/LibGUI/Scrollbar.cpp index c6d67b1013..8de37ae6f8 100644 --- a/Userland/Libraries/LibGUI/Scrollbar.cpp +++ b/Userland/Libraries/LibGUI/Scrollbar.cpp @@ -88,10 +88,6 @@ Scrollbar::Scrollbar(Orientation orientation) }; } -Scrollbar::~Scrollbar() -{ -} - Gfx::IntRect Scrollbar::decrement_button_rect() const { return { 0, 0, button_width(), button_height() }; diff --git a/Userland/Libraries/LibGUI/Scrollbar.h b/Userland/Libraries/LibGUI/Scrollbar.h index c713314f6b..8ebb65532b 100644 --- a/Userland/Libraries/LibGUI/Scrollbar.h +++ b/Userland/Libraries/LibGUI/Scrollbar.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -7,6 +8,7 @@ #pragma once #include <AK/Function.h> +#include <LibCore/Timer.h> #include <LibGUI/AbstractSlider.h> namespace GUI { @@ -15,7 +17,7 @@ class Scrollbar : public AbstractSlider { C_OBJECT(Scrollbar); public: - virtual ~Scrollbar() override; + virtual ~Scrollbar() override = default; bool is_scrollable() const { return max() != min(); } diff --git a/Userland/Libraries/LibGUI/SeparatorWidget.cpp b/Userland/Libraries/LibGUI/SeparatorWidget.cpp index 4e6a490ace..91bd6b137b 100644 --- a/Userland/Libraries/LibGUI/SeparatorWidget.cpp +++ b/Userland/Libraries/LibGUI/SeparatorWidget.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -22,10 +23,6 @@ SeparatorWidget::SeparatorWidget(Gfx::Orientation orientation) set_fixed_height(8); } -SeparatorWidget::~SeparatorWidget() -{ -} - void SeparatorWidget::paint_event(PaintEvent& event) { Painter painter(*this); diff --git a/Userland/Libraries/LibGUI/SeparatorWidget.h b/Userland/Libraries/LibGUI/SeparatorWidget.h index d5c58b6b65..40fc9f62c5 100644 --- a/Userland/Libraries/LibGUI/SeparatorWidget.h +++ b/Userland/Libraries/LibGUI/SeparatorWidget.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -14,7 +15,7 @@ class SeparatorWidget : public Widget { C_OBJECT(SeparatorWidget); public: - virtual ~SeparatorWidget() override; + virtual ~SeparatorWidget() override = default; protected: explicit SeparatorWidget(Gfx::Orientation); @@ -28,7 +29,7 @@ private: class VerticalSeparator final : public SeparatorWidget { C_OBJECT(VerticalSeparator) public: - virtual ~VerticalSeparator() override { } + virtual ~VerticalSeparator() override = default; private: VerticalSeparator() @@ -40,7 +41,7 @@ private: class HorizontalSeparator final : public SeparatorWidget { C_OBJECT(HorizontalSeparator) public: - virtual ~HorizontalSeparator() override { } + virtual ~HorizontalSeparator() override = default; private: HorizontalSeparator() diff --git a/Userland/Libraries/LibGUI/SettingsWindow.cpp b/Userland/Libraries/LibGUI/SettingsWindow.cpp index d4c5d40a6a..84d24bab39 100644 --- a/Userland/Libraries/LibGUI/SettingsWindow.cpp +++ b/Userland/Libraries/LibGUI/SettingsWindow.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, Idan Horowitz <idan.horowitz@serenityos.org> - * Copyright (c) 2021, the SerenityOS developers. + * Copyright (c) 2021-2022, the SerenityOS developers. * Copyright (c) 2021, Andreas Kling <kling@serenityos.org> * Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org> * @@ -76,12 +76,4 @@ ErrorOr<NonnullRefPtr<SettingsWindow>> SettingsWindow::create(String title, Show return window; } -SettingsWindow::SettingsWindow() -{ -} - -SettingsWindow::~SettingsWindow() -{ -} - } diff --git a/Userland/Libraries/LibGUI/SettingsWindow.h b/Userland/Libraries/LibGUI/SettingsWindow.h index d7530b8df2..766ccdbdcd 100644 --- a/Userland/Libraries/LibGUI/SettingsWindow.h +++ b/Userland/Libraries/LibGUI/SettingsWindow.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, Idan Horowitz <idan.horowitz@serenityos.org> - * Copyright (c) 2021, the SerenityOS developers. + * Copyright (c) 2021-2022, the SerenityOS developers. * Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause @@ -31,7 +31,7 @@ public: static ErrorOr<NonnullRefPtr<SettingsWindow>> create(String title, ShowDefaultsButton = ShowDefaultsButton::No); - virtual ~SettingsWindow() override; + virtual ~SettingsWindow() override = default; template<class T, class... Args> ErrorOr<NonnullRefPtr<T>> add_tab(String title, Args&&... args) @@ -42,7 +42,7 @@ public: } private: - SettingsWindow(); + SettingsWindow() = default; RefPtr<GUI::TabWidget> m_tab_widget; NonnullRefPtrVector<Tab> m_tabs; diff --git a/Userland/Libraries/LibGUI/Slider.cpp b/Userland/Libraries/LibGUI/Slider.cpp index 333a194144..b090f63c90 100644 --- a/Userland/Libraries/LibGUI/Slider.cpp +++ b/Userland/Libraries/LibGUI/Slider.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -24,10 +25,6 @@ Slider::Slider(Orientation orientation) { KnobSizeMode::Proportional, "Proportional" }); } -Slider::~Slider() -{ -} - void Slider::paint_event(PaintEvent& event) { Painter painter(*this); diff --git a/Userland/Libraries/LibGUI/Slider.h b/Userland/Libraries/LibGUI/Slider.h index 0eddc3c81e..39cab99b29 100644 --- a/Userland/Libraries/LibGUI/Slider.h +++ b/Userland/Libraries/LibGUI/Slider.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -19,7 +20,7 @@ public: Proportional, }; - virtual ~Slider() override; + virtual ~Slider() override = default; void set_knob_size_mode(KnobSizeMode mode) { m_knob_size_mode = mode; } KnobSizeMode knob_size_mode() const { return m_knob_size_mode; } @@ -64,7 +65,7 @@ class VerticalSlider final : public Slider { C_OBJECT(VerticalSlider); public: - virtual ~VerticalSlider() override { } + virtual ~VerticalSlider() override = default; private: VerticalSlider() @@ -77,7 +78,7 @@ class HorizontalSlider final : public Slider { C_OBJECT(HorizontalSlider); public: - virtual ~HorizontalSlider() override { } + virtual ~HorizontalSlider() override = default; private: HorizontalSlider() diff --git a/Userland/Libraries/LibGUI/SpinBox.cpp b/Userland/Libraries/LibGUI/SpinBox.cpp index e46278376b..59676e8587 100644 --- a/Userland/Libraries/LibGUI/SpinBox.cpp +++ b/Userland/Libraries/LibGUI/SpinBox.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -52,10 +53,6 @@ SpinBox::SpinBox() REGISTER_INT_PROPERTY("max", max, set_max); } -SpinBox::~SpinBox() -{ -} - void SpinBox::set_value(int value, AllowCallback allow_callback) { value = clamp(value, m_min, m_max); diff --git a/Userland/Libraries/LibGUI/SpinBox.h b/Userland/Libraries/LibGUI/SpinBox.h index b71b900dde..cdd0849ec4 100644 --- a/Userland/Libraries/LibGUI/SpinBox.h +++ b/Userland/Libraries/LibGUI/SpinBox.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -13,7 +14,7 @@ namespace GUI { class SpinBox : public Widget { C_OBJECT(SpinBox) public: - virtual ~SpinBox() override; + virtual ~SpinBox() override = default; int value() const { return m_value; } void set_value(int, AllowCallback = AllowCallback::Yes); diff --git a/Userland/Libraries/LibGUI/Splitter.cpp b/Userland/Libraries/LibGUI/Splitter.cpp index 0571b47d4c..83ffdd4064 100644 --- a/Userland/Libraries/LibGUI/Splitter.cpp +++ b/Userland/Libraries/LibGUI/Splitter.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -33,10 +34,6 @@ Splitter::Splitter(Orientation orientation) layout()->set_spacing(4); } -Splitter::~Splitter() -{ -} - void Splitter::paint_event(PaintEvent& event) { Painter painter(*this); diff --git a/Userland/Libraries/LibGUI/Splitter.h b/Userland/Libraries/LibGUI/Splitter.h index ad21a0747f..c48e82e2c0 100644 --- a/Userland/Libraries/LibGUI/Splitter.h +++ b/Userland/Libraries/LibGUI/Splitter.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -19,7 +20,7 @@ public: Second }; - virtual ~Splitter() override; + virtual ~Splitter() override = default; int first_resizee_minimum_size() { return m_first_resizee_minimum_size; } void set_first_resizee_minimum_size(int minimum_size) { m_first_resizee_minimum_size = minimum_size; } @@ -84,7 +85,7 @@ private: class VerticalSplitter final : public Splitter { C_OBJECT(VerticalSplitter) public: - virtual ~VerticalSplitter() override { } + virtual ~VerticalSplitter() override = default; private: VerticalSplitter() @@ -96,7 +97,7 @@ private: class HorizontalSplitter final : public Splitter { C_OBJECT(HorizontalSplitter) public: - virtual ~HorizontalSplitter() override { } + virtual ~HorizontalSplitter() override = default; private: HorizontalSplitter() diff --git a/Userland/Libraries/LibGUI/StackWidget.cpp b/Userland/Libraries/LibGUI/StackWidget.cpp index 1a618a51c6..a5b6aca595 100644 --- a/Userland/Libraries/LibGUI/StackWidget.cpp +++ b/Userland/Libraries/LibGUI/StackWidget.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -12,14 +13,6 @@ REGISTER_WIDGET(GUI, StackWidget); namespace GUI { -StackWidget::StackWidget() -{ -} - -StackWidget::~StackWidget() -{ -} - void StackWidget::set_active_widget(Widget* widget) { if (widget == m_active_widget) diff --git a/Userland/Libraries/LibGUI/StackWidget.h b/Userland/Libraries/LibGUI/StackWidget.h index b2d9568023..0f9dc7170b 100644 --- a/Userland/Libraries/LibGUI/StackWidget.h +++ b/Userland/Libraries/LibGUI/StackWidget.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -13,7 +14,7 @@ namespace GUI { class StackWidget : public Widget { C_OBJECT(StackWidget) public: - virtual ~StackWidget() override; + virtual ~StackWidget() override = default; Widget* active_widget() { return m_active_widget.ptr(); } const Widget* active_widget() const { return m_active_widget.ptr(); } @@ -22,7 +23,7 @@ public: Function<void(Widget*)> on_active_widget_change; protected: - StackWidget(); + StackWidget() = default; virtual void child_event(Core::ChildEvent&) override; virtual void resize_event(ResizeEvent&) override; diff --git a/Userland/Libraries/LibGUI/Statusbar.cpp b/Userland/Libraries/LibGUI/Statusbar.cpp index abce4af03c..f19d9f5c03 100644 --- a/Userland/Libraries/LibGUI/Statusbar.cpp +++ b/Userland/Libraries/LibGUI/Statusbar.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -30,10 +31,6 @@ Statusbar::Statusbar(int count) REGISTER_INT_PROPERTY("segment_count", segment_count, set_segment_count); } -Statusbar::~Statusbar() -{ -} - NonnullRefPtr<Statusbar::Segment> Statusbar::create_segment() { auto widget = Segment::construct(); diff --git a/Userland/Libraries/LibGUI/Statusbar.h b/Userland/Libraries/LibGUI/Statusbar.h index 818eb04037..197e8f7ceb 100644 --- a/Userland/Libraries/LibGUI/Statusbar.h +++ b/Userland/Libraries/LibGUI/Statusbar.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -16,7 +17,7 @@ namespace GUI { class Statusbar : public Widget { C_OBJECT(Statusbar) public: - virtual ~Statusbar() override; + virtual ~Statusbar() override = default; String text(size_t index = 0) const; void set_text(String); diff --git a/Userland/Libraries/LibGUI/TabWidget.cpp b/Userland/Libraries/LibGUI/TabWidget.cpp index 76d6d577b0..f9f6e23aa9 100644 --- a/Userland/Libraries/LibGUI/TabWidget.cpp +++ b/Userland/Libraries/LibGUI/TabWidget.cpp @@ -1,6 +1,7 @@ /* * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org> * Copyright (c) 2021, Peter Elliott <pelliott@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -40,10 +41,6 @@ TabWidget::TabWidget() }); } -TabWidget::~TabWidget() -{ -} - ErrorOr<void> TabWidget::try_add_widget(String title, Widget& widget) { m_tabs.append({ move(title), nullptr, &widget }); diff --git a/Userland/Libraries/LibGUI/TabWidget.h b/Userland/Libraries/LibGUI/TabWidget.h index d3d4977f6c..c3a793374d 100644 --- a/Userland/Libraries/LibGUI/TabWidget.h +++ b/Userland/Libraries/LibGUI/TabWidget.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -19,7 +20,7 @@ public: Bottom, }; - virtual ~TabWidget() override; + virtual ~TabWidget() override = default; TabPosition tab_position() const { return m_tab_position; } void set_tab_position(TabPosition); diff --git a/Userland/Libraries/LibGUI/TableView.cpp b/Userland/Libraries/LibGUI/TableView.cpp index a7c6568988..0820bb4172 100644 --- a/Userland/Libraries/LibGUI/TableView.cpp +++ b/Userland/Libraries/LibGUI/TableView.cpp @@ -1,6 +1,7 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> * Copyright (c) 2022, Glenford Williams <gw_dev@outlook.com> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -27,10 +28,6 @@ TableView::TableView() set_foreground_role(ColorRole::BaseText); } -TableView::~TableView() -{ -} - void TableView::paint_event(PaintEvent& event) { Color widget_background_color = palette().color(background_role()); diff --git a/Userland/Libraries/LibGUI/TableView.h b/Userland/Libraries/LibGUI/TableView.h index f6736b34e2..94f7f13ae3 100644 --- a/Userland/Libraries/LibGUI/TableView.h +++ b/Userland/Libraries/LibGUI/TableView.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -13,7 +14,7 @@ namespace GUI { class TableView : public AbstractTableView { C_OBJECT(TableView) public: - virtual ~TableView() override; + virtual ~TableView() override = default; enum class GridStyle { None, diff --git a/Userland/Libraries/LibGUI/TextBox.cpp b/Userland/Libraries/LibGUI/TextBox.cpp index 909cd9627a..c70d2cd862 100644 --- a/Userland/Libraries/LibGUI/TextBox.cpp +++ b/Userland/Libraries/LibGUI/TextBox.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -19,10 +20,6 @@ TextBox::TextBox() set_fixed_height(22); } -TextBox::~TextBox() -{ -} - void TextBox::keydown_event(GUI::KeyEvent& event) { TextEditor::keydown_event(event); @@ -87,10 +84,6 @@ UrlBox::UrlBox() set_auto_focusable(false); } -UrlBox::~UrlBox() -{ -} - void UrlBox::focusout_event(GUI::FocusEvent& event) { set_focus_transition(true); diff --git a/Userland/Libraries/LibGUI/TextBox.h b/Userland/Libraries/LibGUI/TextBox.h index ccc53722c1..fc73af4d74 100644 --- a/Userland/Libraries/LibGUI/TextBox.h +++ b/Userland/Libraries/LibGUI/TextBox.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -14,7 +15,7 @@ namespace GUI { class TextBox : public TextEditor { C_OBJECT(TextBox) public: - virtual ~TextBox() override; + virtual ~TextBox() override = default; Function<void()> on_up_pressed; Function<void()> on_down_pressed; @@ -48,7 +49,7 @@ private: class UrlBox : public TextBox { C_OBJECT(UrlBox) public: - virtual ~UrlBox() override; + virtual ~UrlBox() override = default; void set_focus_transition(bool focus_transition) { m_focus_transition = focus_transition; } bool is_focus_transition() const { return m_focus_transition; } diff --git a/Userland/Libraries/LibGUI/TextDocument.cpp b/Userland/Libraries/LibGUI/TextDocument.cpp index e24b3a388f..4cf24c83b6 100644 --- a/Userland/Libraries/LibGUI/TextDocument.cpp +++ b/Userland/Libraries/LibGUI/TextDocument.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -35,10 +36,6 @@ TextDocument::TextDocument(Client* client) }; } -TextDocument::~TextDocument() -{ -} - bool TextDocument::set_text(StringView text, AllowCallback allow_callback) { m_client_notifications_enabled = false; @@ -289,10 +286,6 @@ void TextDocument::remove_all_lines() } } -TextDocument::Client::~Client() -{ -} - void TextDocument::register_client(Client& client) { m_clients.set(&client); @@ -753,10 +746,6 @@ TextDocumentUndoCommand::TextDocumentUndoCommand(TextDocument& document) { } -TextDocumentUndoCommand::~TextDocumentUndoCommand() -{ -} - InsertTextCommand::InsertTextCommand(TextDocument& document, const String& text, const TextPosition& position) : TextDocumentUndoCommand(document) , m_text(text) diff --git a/Userland/Libraries/LibGUI/TextDocument.h b/Userland/Libraries/LibGUI/TextDocument.h index efe7a3e4e0..db611dda69 100644 --- a/Userland/Libraries/LibGUI/TextDocument.h +++ b/Userland/Libraries/LibGUI/TextDocument.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -40,7 +41,7 @@ public: class Client { public: - virtual ~Client(); + virtual ~Client() = default; virtual void document_did_append_line() = 0; virtual void document_did_insert_line(size_t) = 0; virtual void document_did_remove_line(size_t) = 0; @@ -55,7 +56,7 @@ public: }; static NonnullRefPtr<TextDocument> create(Client* client = nullptr); - virtual ~TextDocument(); + virtual ~TextDocument() = default; size_t line_count() const { return m_lines.size(); } const TextDocumentLine& line(size_t line_index) const { return m_lines[line_index]; } @@ -187,7 +188,7 @@ private: class TextDocumentUndoCommand : public Command { public: TextDocumentUndoCommand(TextDocument&); - virtual ~TextDocumentUndoCommand(); + virtual ~TextDocumentUndoCommand() = default; virtual void perform_formatting(const TextDocument::Client&) { } void execute_from(const TextDocument::Client& client) diff --git a/Userland/Libraries/LibGUI/TextRange.h b/Userland/Libraries/LibGUI/TextRange.h index de9f13102c..736e2baa3d 100644 --- a/Userland/Libraries/LibGUI/TextRange.h +++ b/Userland/Libraries/LibGUI/TextRange.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -12,7 +13,7 @@ namespace GUI { class TextRange { public: - TextRange() { } + TextRange() = default; TextRange(const TextPosition& start, const TextPosition& end) : m_start(start) , m_end(end) diff --git a/Userland/Libraries/LibGUI/Toolbar.cpp b/Userland/Libraries/LibGUI/Toolbar.cpp index b87d172a3d..f42865341f 100644 --- a/Userland/Libraries/LibGUI/Toolbar.cpp +++ b/Userland/Libraries/LibGUI/Toolbar.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -35,15 +36,11 @@ Toolbar::Toolbar(Orientation orientation, int button_size) layout()->set_margins({ 2, 2, 2, 2 }); } -Toolbar::~Toolbar() -{ -} - class ToolbarButton final : public Button { C_OBJECT(ToolbarButton); public: - virtual ~ToolbarButton() override { } + virtual ~ToolbarButton() override = default; private: explicit ToolbarButton(Action& action) diff --git a/Userland/Libraries/LibGUI/Toolbar.h b/Userland/Libraries/LibGUI/Toolbar.h index 8070867d2b..0c51a82c6b 100644 --- a/Userland/Libraries/LibGUI/Toolbar.h +++ b/Userland/Libraries/LibGUI/Toolbar.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -15,7 +16,7 @@ namespace GUI { class Toolbar : public Widget { C_OBJECT(Toolbar) public: - virtual ~Toolbar() override; + virtual ~Toolbar() override = default; ErrorOr<NonnullRefPtr<GUI::Button>> try_add_action(GUI::Action&); ErrorOr<void> try_add_separator(); diff --git a/Userland/Libraries/LibGUI/Tray.cpp b/Userland/Libraries/LibGUI/Tray.cpp index a15c095fce..a2cea687e1 100644 --- a/Userland/Libraries/LibGUI/Tray.cpp +++ b/Userland/Libraries/LibGUI/Tray.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -21,10 +22,6 @@ Tray::Tray() set_focus_policy(GUI::FocusPolicy::TabFocus); } -Tray::~Tray() -{ -} - Gfx::IntRect Tray::Item::rect(Tray const& tray) const { static constexpr int item_height = 22; diff --git a/Userland/Libraries/LibGUI/Tray.h b/Userland/Libraries/LibGUI/Tray.h index 57e019fe01..9ffe2282d0 100644 --- a/Userland/Libraries/LibGUI/Tray.h +++ b/Userland/Libraries/LibGUI/Tray.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -15,7 +16,7 @@ class Tray : public GUI::Frame { C_OBJECT(Tray); public: - virtual ~Tray() override; + virtual ~Tray() override = default; size_t add_item(String text, RefPtr<Gfx::Bitmap>, String custom_data); diff --git a/Userland/Libraries/LibGUI/TreeView.cpp b/Userland/Libraries/LibGUI/TreeView.cpp index c7f6d0f390..50a20e9e94 100644 --- a/Userland/Libraries/LibGUI/TreeView.cpp +++ b/Userland/Libraries/LibGUI/TreeView.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -43,10 +44,6 @@ TreeView::TreeView() m_collapse_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/serenity/treeview-collapse.png").release_value_but_fixme_should_propagate_errors(); } -TreeView::~TreeView() -{ -} - ModelIndex TreeView::index_at_event_position(const Gfx::IntPoint& a_position, bool& is_toggle) const { auto position = a_position.translated(0, -column_header().height()).translated(horizontal_scrollbar().value() - frame_thickness(), vertical_scrollbar().value() - frame_thickness()); diff --git a/Userland/Libraries/LibGUI/TreeView.h b/Userland/Libraries/LibGUI/TreeView.h index 6b91783af1..abb9c40436 100644 --- a/Userland/Libraries/LibGUI/TreeView.h +++ b/Userland/Libraries/LibGUI/TreeView.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -14,7 +15,7 @@ namespace GUI { class TreeView : public AbstractTableView { C_OBJECT(TreeView) public: - virtual ~TreeView() override; + virtual ~TreeView() override = default; virtual void scroll_into_view(const ModelIndex&, bool scroll_horizontally, bool scroll_vertically) override; diff --git a/Userland/Libraries/LibGUI/UndoStack.cpp b/Userland/Libraries/LibGUI/UndoStack.cpp index 6c265672c4..6ac2205648 100644 --- a/Userland/Libraries/LibGUI/UndoStack.cpp +++ b/Userland/Libraries/LibGUI/UndoStack.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -9,14 +10,6 @@ namespace GUI { -UndoStack::UndoStack() -{ -} - -UndoStack::~UndoStack() -{ -} - bool UndoStack::can_undo() const { return m_stack_index > 0; diff --git a/Userland/Libraries/LibGUI/UndoStack.h b/Userland/Libraries/LibGUI/UndoStack.h index cfc0b2c6ca..ab58d140e5 100644 --- a/Userland/Libraries/LibGUI/UndoStack.h +++ b/Userland/Libraries/LibGUI/UndoStack.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -15,8 +16,8 @@ namespace GUI { class UndoStack { public: - UndoStack(); - ~UndoStack(); + UndoStack() = default; + ~UndoStack() = default; void push(NonnullOwnPtr<Command>); diff --git a/Userland/Libraries/LibGUI/ValueSlider.cpp b/Userland/Libraries/LibGUI/ValueSlider.cpp index 42e09f0be7..b7995fd0f8 100644 --- a/Userland/Libraries/LibGUI/ValueSlider.cpp +++ b/Userland/Libraries/LibGUI/ValueSlider.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2021, Marcus Nilsson <brainbomb@gmail.com> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -67,10 +68,6 @@ ValueSlider::ValueSlider(Gfx::Orientation orientation, String suffix) }; } -ValueSlider::~ValueSlider() -{ -} - String ValueSlider::formatted_value() const { return String::formatted("{:2}{}", value(), m_suffix); diff --git a/Userland/Libraries/LibGUI/ValueSlider.h b/Userland/Libraries/LibGUI/ValueSlider.h index 8fa3e8c2cc..546917fbdd 100644 --- a/Userland/Libraries/LibGUI/ValueSlider.h +++ b/Userland/Libraries/LibGUI/ValueSlider.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2021, Marcus Nilsson <brainbomb@gmail.com> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -19,7 +20,7 @@ public: Thin, }; - virtual ~ValueSlider() override; + virtual ~ValueSlider() override = default; void set_suffix(String suffix) { m_suffix = move(suffix); } void set_knob_style(KnobStyle knobstyle) { m_knob_style = knobstyle; } diff --git a/Userland/Libraries/LibGUI/Widget.cpp b/Userland/Libraries/LibGUI/Widget.cpp index 6f094a6d6c..7686960b5e 100644 --- a/Userland/Libraries/LibGUI/Widget.cpp +++ b/Userland/Libraries/LibGUI/Widget.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -188,9 +189,7 @@ Widget::Widget() }); } -Widget::~Widget() -{ -} +Widget::~Widget() = default; void Widget::child_event(Core::ChildEvent& event) { diff --git a/Userland/Libraries/LibGUI/Widget.h b/Userland/Libraries/LibGUI/Widget.h index c6e1391269..f6fb217c2e 100644 --- a/Userland/Libraries/LibGUI/Widget.h +++ b/Userland/Libraries/LibGUI/Widget.h @@ -12,6 +12,7 @@ #include <AK/String.h> #include <AK/Variant.h> #include <LibCore/Object.h> +#include <LibCore/Timer.h> #include <LibGUI/Event.h> #include <LibGUI/FocusPolicy.h> #include <LibGUI/Forward.h> diff --git a/Userland/Libraries/LibGUI/Wizards/AbstractWizardPage.cpp b/Userland/Libraries/LibGUI/Wizards/AbstractWizardPage.cpp index b52e90a5c4..b8ae89085d 100644 --- a/Userland/Libraries/LibGUI/Wizards/AbstractWizardPage.cpp +++ b/Userland/Libraries/LibGUI/Wizards/AbstractWizardPage.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2021, Nick Vella <nick@nxk.io> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -8,14 +9,6 @@ namespace GUI { -AbstractWizardPage::AbstractWizardPage() -{ -} - -AbstractWizardPage::~AbstractWizardPage() -{ -} - RefPtr<AbstractWizardPage> AbstractWizardPage::next_page() { if (on_next_page) diff --git a/Userland/Libraries/LibGUI/Wizards/AbstractWizardPage.h b/Userland/Libraries/LibGUI/Wizards/AbstractWizardPage.h index a1d6d41316..8b518a4f3d 100644 --- a/Userland/Libraries/LibGUI/Wizards/AbstractWizardPage.h +++ b/Userland/Libraries/LibGUI/Wizards/AbstractWizardPage.h @@ -15,7 +15,7 @@ class AbstractWizardPage : public Widget { C_OBJECT_ABSTRACT(AbstractWizardPage); public: - virtual ~AbstractWizardPage() override; + virtual ~AbstractWizardPage() override = default; Function<RefPtr<AbstractWizardPage>()> on_next_page; virtual RefPtr<AbstractWizardPage> next_page(); @@ -31,7 +31,7 @@ public: void set_is_final_page(bool val) { m_is_final_page = val; } protected: - AbstractWizardPage(); + AbstractWizardPage() = default; private: bool m_is_final_page { false }; diff --git a/Userland/Libraries/LibGUI/Wizards/WizardDialog.cpp b/Userland/Libraries/LibGUI/Wizards/WizardDialog.cpp index a1978fd511..c1d3cad741 100644 --- a/Userland/Libraries/LibGUI/Wizards/WizardDialog.cpp +++ b/Userland/Libraries/LibGUI/Wizards/WizardDialog.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2021, Nick Vella <nick@nxk.io> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -78,10 +79,6 @@ WizardDialog::WizardDialog(Window* parent_window) update_navigation(); } -WizardDialog::~WizardDialog() -{ -} - void WizardDialog::push_page(AbstractWizardPage& page) { if (!m_page_stack.is_empty()) diff --git a/Userland/Libraries/LibGUI/Wizards/WizardDialog.h b/Userland/Libraries/LibGUI/Wizards/WizardDialog.h index d87f43c097..f8ce753025 100644 --- a/Userland/Libraries/LibGUI/Wizards/WizardDialog.h +++ b/Userland/Libraries/LibGUI/Wizards/WizardDialog.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2021, Nick Vella <nick@nxk.io> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -15,7 +16,7 @@ namespace GUI { class WizardDialog : public Dialog { C_OBJECT(WizardDialog) public: - virtual ~WizardDialog() override; + virtual ~WizardDialog() override = default; static void show(AbstractWizardPage& first_page, Window* parent_window = nullptr) { |