mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 20:57:35 +00:00
Applications: Use default constructors/destructors
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
This commit is contained in:
parent
6be75bd5e4
commit
160bda7228
195 changed files with 335 additions and 638 deletions
|
@ -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 @@
|
|||
#include <LibGfx/Path.h>
|
||||
#include <LibGfx/SystemTheme.h>
|
||||
|
||||
GraphWidget::GraphWidget()
|
||||
{
|
||||
}
|
||||
|
||||
GraphWidget::~GraphWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void GraphWidget::add_value(Vector<u64, 1>&& value)
|
||||
{
|
||||
m_values.enqueue(move(value));
|
||||
|
|
|
@ -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 @@
|
|||
class GraphWidget final : public GUI::Frame {
|
||||
C_OBJECT(GraphWidget)
|
||||
public:
|
||||
virtual ~GraphWidget() override;
|
||||
virtual ~GraphWidget() override = default;
|
||||
|
||||
void set_max(u64 max) { m_max = max; }
|
||||
u64 max() const { return m_max; }
|
||||
|
@ -34,7 +35,7 @@ public:
|
|||
void set_stack_values(bool stack_values) { m_stack_values = stack_values; }
|
||||
|
||||
private:
|
||||
explicit GraphWidget();
|
||||
explicit GraphWidget() = default;
|
||||
|
||||
virtual void paint_event(GUI::PaintEvent&) override;
|
||||
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
@ -58,10 +59,6 @@ MemoryStatsWidget::MemoryStatsWidget(GraphWidget& graph)
|
|||
refresh();
|
||||
}
|
||||
|
||||
MemoryStatsWidget::~MemoryStatsWidget()
|
||||
{
|
||||
}
|
||||
|
||||
static inline u64 page_count_to_bytes(size_t count)
|
||||
{
|
||||
return count * 4096;
|
||||
|
|
|
@ -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 MemoryStatsWidget final : public GUI::Widget {
|
|||
public:
|
||||
static MemoryStatsWidget* the();
|
||||
|
||||
virtual ~MemoryStatsWidget() override;
|
||||
virtual ~MemoryStatsWidget() override = default;
|
||||
|
||||
void refresh();
|
||||
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
@ -111,10 +112,6 @@ NetworkStatisticsWidget::NetworkStatisticsWidget()
|
|||
};
|
||||
}
|
||||
|
||||
NetworkStatisticsWidget::~NetworkStatisticsWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void NetworkStatisticsWidget::update_models()
|
||||
{
|
||||
m_adapter_model->invalidate();
|
||||
|
|
|
@ -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 @@
|
|||
class NetworkStatisticsWidget final : public GUI::LazyWidget {
|
||||
C_OBJECT(NetworkStatisticsWidget)
|
||||
public:
|
||||
virtual ~NetworkStatisticsWidget() override;
|
||||
virtual ~NetworkStatisticsWidget() override = default;
|
||||
|
||||
private:
|
||||
NetworkStatisticsWidget();
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
@ -41,10 +42,6 @@ ProcessFileDescriptorMapWidget::ProcessFileDescriptorMapWidget()
|
|||
m_table_view->set_model(MUST(GUI::SortingProxyModel::create(*m_model)));
|
||||
}
|
||||
|
||||
ProcessFileDescriptorMapWidget::~ProcessFileDescriptorMapWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void ProcessFileDescriptorMapWidget::set_pid(pid_t pid)
|
||||
{
|
||||
if (m_pid == pid)
|
||||
|
|
|
@ -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 @@ class ProcessFileDescriptorMapWidget final : public GUI::Widget {
|
|||
C_OBJECT(ProcessFileDescriptorMapWidget);
|
||||
|
||||
public:
|
||||
virtual ~ProcessFileDescriptorMapWidget() override;
|
||||
virtual ~ProcessFileDescriptorMapWidget() override = default;
|
||||
|
||||
void set_pid(pid_t);
|
||||
|
||||
|
|
|
@ -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 PagemapPaintingDelegate final : public GUI::TableCellPaintingDelegate {
|
||||
public:
|
||||
virtual ~PagemapPaintingDelegate() override { }
|
||||
virtual ~PagemapPaintingDelegate() override = default;
|
||||
|
||||
virtual void paint(GUI::Painter& painter, const Gfx::IntRect& a_rect, const Gfx::Palette&, const GUI::ModelIndex& index) override
|
||||
{
|
||||
|
@ -107,10 +108,6 @@ ProcessMemoryMapWidget::ProcessMemoryMapWidget()
|
|||
m_timer = add<Core::Timer>(1000, [this] { refresh(); });
|
||||
}
|
||||
|
||||
ProcessMemoryMapWidget::~ProcessMemoryMapWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void ProcessMemoryMapWidget::set_pid(pid_t pid)
|
||||
{
|
||||
if (m_pid == pid)
|
||||
|
|
|
@ -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 @@ class ProcessMemoryMapWidget final : public GUI::Widget {
|
|||
C_OBJECT(ProcessMemoryMapWidget);
|
||||
|
||||
public:
|
||||
virtual ~ProcessMemoryMapWidget() override;
|
||||
virtual ~ProcessMemoryMapWidget() override = default;
|
||||
|
||||
void set_pid(pid_t);
|
||||
void refresh();
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
@ -43,10 +44,6 @@ ProcessModel::ProcessModel()
|
|||
m_kernel_process_icon = GUI::Icon::default_icon("gear");
|
||||
}
|
||||
|
||||
ProcessModel::~ProcessModel()
|
||||
{
|
||||
}
|
||||
|
||||
int ProcessModel::row_count(GUI::ModelIndex const&) const
|
||||
{
|
||||
return m_tids.size();
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
@ -54,7 +55,7 @@ public:
|
|||
static ProcessModel& the();
|
||||
|
||||
static NonnullRefPtr<ProcessModel> create() { return adopt_ref(*new ProcessModel); }
|
||||
virtual ~ProcessModel() override;
|
||||
virtual ~ProcessModel() override = default;
|
||||
|
||||
virtual int row_count(GUI::ModelIndex const&) const override;
|
||||
virtual int column_count(GUI::ModelIndex const&) const override;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -89,7 +90,3 @@ ProcessStateWidget::ProcessStateWidget(pid_t pid)
|
|||
m_table_view->column_header().set_visible(false);
|
||||
m_table_view->column_header().set_section_size(0, 90);
|
||||
}
|
||||
|
||||
ProcessStateWidget::~ProcessStateWidget()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -12,7 +13,7 @@ class ProcessStateWidget final : public GUI::Widget {
|
|||
C_OBJECT(ProcessStateWidget);
|
||||
|
||||
public:
|
||||
virtual ~ProcessStateWidget() override;
|
||||
virtual ~ProcessStateWidget() override = default;
|
||||
|
||||
private:
|
||||
explicit ProcessStateWidget(pid_t);
|
||||
|
|
|
@ -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 @@ ProcessUnveiledPathsWidget::ProcessUnveiledPathsWidget()
|
|||
m_table_view->set_model(MUST(GUI::SortingProxyModel::create(*m_model)));
|
||||
}
|
||||
|
||||
ProcessUnveiledPathsWidget::~ProcessUnveiledPathsWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void ProcessUnveiledPathsWidget::set_pid(pid_t pid)
|
||||
{
|
||||
if (m_pid == pid)
|
||||
|
|
|
@ -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 @@ class ProcessUnveiledPathsWidget final : public GUI::Widget {
|
|||
C_OBJECT(ProcessUnveiledPathsWidget);
|
||||
|
||||
public:
|
||||
virtual ~ProcessUnveiledPathsWidget() override;
|
||||
virtual ~ProcessUnveiledPathsWidget() override = default;
|
||||
|
||||
void set_pid(pid_t);
|
||||
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
@ -73,10 +74,6 @@ ThreadStackWidget::ThreadStackWidget()
|
|||
m_stack_table->set_model(adopt_ref(*new ThreadStackModel()));
|
||||
}
|
||||
|
||||
ThreadStackWidget::~ThreadStackWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void ThreadStackWidget::show_event(GUI::ShowEvent&)
|
||||
{
|
||||
refresh();
|
||||
|
|
|
@ -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 @@
|
|||
class ThreadStackWidget final : public GUI::Widget {
|
||||
C_OBJECT(ThreadStackWidget)
|
||||
public:
|
||||
virtual ~ThreadStackWidget() override;
|
||||
virtual ~ThreadStackWidget() override = default;
|
||||
|
||||
void set_ids(pid_t pid, pid_t tid);
|
||||
void refresh();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2021, Undefine <cqundefine@gmail.com>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -61,7 +62,7 @@ static RefPtr<GUI::Statusbar> statusbar;
|
|||
class UnavailableProcessWidget final : public GUI::Frame {
|
||||
C_OBJECT(UnavailableProcessWidget)
|
||||
public:
|
||||
virtual ~UnavailableProcessWidget() override { }
|
||||
virtual ~UnavailableProcessWidget() override = default;
|
||||
|
||||
const String& text() const { return m_text; }
|
||||
void set_text(String text) { m_text = move(text); }
|
||||
|
@ -383,7 +384,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
class ProgressbarPaintingDelegate final : public GUI::TableCellPaintingDelegate {
|
||||
public:
|
||||
virtual ~ProgressbarPaintingDelegate() override { }
|
||||
virtual ~ProgressbarPaintingDelegate() override = default;
|
||||
|
||||
virtual void paint(GUI::Painter& painter, const Gfx::IntRect& a_rect, const Palette& palette, const GUI::ModelIndex& index) override
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue