mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 13:37:45 +00:00
DevTools: 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
84f87a9f76
commit
7070713ec8
50 changed files with 75 additions and 122 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -122,10 +123,6 @@ DisassemblyModel::DisassemblyModel(Profile& profile, ProfileNode& node)
|
|||
}
|
||||
}
|
||||
|
||||
DisassemblyModel::~DisassemblyModel()
|
||||
{
|
||||
}
|
||||
|
||||
int DisassemblyModel::row_count(GUI::ModelIndex const&) const
|
||||
{
|
||||
return m_instructions.size();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -41,7 +42,7 @@ public:
|
|||
__Count
|
||||
};
|
||||
|
||||
virtual ~DisassemblyModel() override;
|
||||
virtual ~DisassemblyModel() override = default;
|
||||
|
||||
virtual int row_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override;
|
||||
virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return Column::__Count; }
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
@ -17,10 +18,6 @@ IndividualSampleModel::IndividualSampleModel(Profile& profile, size_t event_inde
|
|||
{
|
||||
}
|
||||
|
||||
IndividualSampleModel::~IndividualSampleModel()
|
||||
{
|
||||
}
|
||||
|
||||
int IndividualSampleModel::row_count(GUI::ModelIndex const&) const
|
||||
{
|
||||
auto const& event = m_profile.events().at(m_event_index);
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
@ -26,7 +27,7 @@ public:
|
|||
__Count
|
||||
};
|
||||
|
||||
virtual ~IndividualSampleModel() override;
|
||||
virtual ~IndividualSampleModel() override = default;
|
||||
|
||||
virtual int row_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override;
|
||||
virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const 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
|
||||
*/
|
||||
|
@ -19,10 +20,6 @@ ProfileModel::ProfileModel(Profile& profile)
|
|||
m_kernel_frame_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/inspector-object-red.png").release_value_but_fixme_should_propagate_errors());
|
||||
}
|
||||
|
||||
ProfileModel::~ProfileModel()
|
||||
{
|
||||
}
|
||||
|
||||
GUI::ModelIndex ProfileModel::index(int row, int column, GUI::ModelIndex const& parent) const
|
||||
{
|
||||
if (!parent.is_valid()) {
|
||||
|
|
|
@ -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,7 +29,7 @@ public:
|
|||
__Count
|
||||
};
|
||||
|
||||
virtual ~ProfileModel() override;
|
||||
virtual ~ProfileModel() override = default;
|
||||
|
||||
virtual int row_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override;
|
||||
virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override;
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
@ -17,10 +18,6 @@ SamplesModel::SamplesModel(Profile& profile)
|
|||
m_kernel_frame_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/inspector-object-red.png").release_value_but_fixme_should_propagate_errors());
|
||||
}
|
||||
|
||||
SamplesModel::~SamplesModel()
|
||||
{
|
||||
}
|
||||
|
||||
int SamplesModel::row_count(GUI::ModelIndex const&) const
|
||||
{
|
||||
return m_profile.filtered_event_indices().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
|
||||
*/
|
||||
|
@ -31,7 +32,7 @@ public:
|
|||
__Count
|
||||
};
|
||||
|
||||
virtual ~SamplesModel() override;
|
||||
virtual ~SamplesModel() override = default;
|
||||
|
||||
virtual int row_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override;
|
||||
virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) 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
|
||||
*/
|
||||
|
@ -15,10 +16,6 @@ SignpostsModel::SignpostsModel(Profile& profile)
|
|||
{
|
||||
}
|
||||
|
||||
SignpostsModel::~SignpostsModel()
|
||||
{
|
||||
}
|
||||
|
||||
int SignpostsModel::row_count(GUI::ModelIndex const&) const
|
||||
{
|
||||
return m_profile.filtered_signpost_indices().size();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -30,7 +31,7 @@ public:
|
|||
__Count
|
||||
};
|
||||
|
||||
virtual ~SignpostsModel() override;
|
||||
virtual ~SignpostsModel() override = default;
|
||||
|
||||
virtual int row_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override;
|
||||
virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) 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
|
||||
*/
|
||||
|
@ -31,10 +32,6 @@ TimelineContainer::TimelineContainer(GUI::Widget& header_container, TimelineView
|
|||
};
|
||||
}
|
||||
|
||||
TimelineContainer::~TimelineContainer()
|
||||
{
|
||||
}
|
||||
|
||||
void TimelineContainer::did_scroll()
|
||||
{
|
||||
AbstractScrollableWidget::did_scroll();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -16,7 +17,7 @@ class TimelineContainer : public GUI::AbstractScrollableWidget {
|
|||
C_OBJECT(TimelineContainer);
|
||||
|
||||
public:
|
||||
virtual ~TimelineContainer();
|
||||
virtual ~TimelineContainer() override = default;
|
||||
|
||||
protected:
|
||||
virtual void did_scroll() 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
|
||||
*/
|
||||
|
@ -27,10 +28,6 @@ TimelineHeader::TimelineHeader(Profile& profile, Process const& process)
|
|||
m_text = String::formatted("{} ({})", LexicalPath::basename(m_process.executable), m_process.pid);
|
||||
}
|
||||
|
||||
TimelineHeader::~TimelineHeader()
|
||||
{
|
||||
}
|
||||
|
||||
void TimelineHeader::paint_event(GUI::PaintEvent& event)
|
||||
{
|
||||
GUI::Frame::paint_event(event);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -17,7 +18,7 @@ class TimelineHeader final : public GUI::Frame {
|
|||
C_OBJECT(TimelineHeader);
|
||||
|
||||
public:
|
||||
virtual ~TimelineHeader();
|
||||
virtual ~TimelineHeader() override = default;
|
||||
|
||||
Function<void(bool)> on_selection_change;
|
||||
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
@ -25,10 +26,6 @@ TimelineTrack::TimelineTrack(TimelineView const& view, Profile const& profile, P
|
|||
set_frame_thickness(1);
|
||||
}
|
||||
|
||||
TimelineTrack::~TimelineTrack()
|
||||
{
|
||||
}
|
||||
|
||||
void TimelineTrack::set_scale(float scale)
|
||||
{
|
||||
set_fixed_width(m_profile.length_in_ms() / scale);
|
||||
|
|
|
@ -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 @@ class TimelineTrack final : public GUI::Frame {
|
|||
C_OBJECT(TimelineTrack);
|
||||
|
||||
public:
|
||||
virtual ~TimelineTrack() override;
|
||||
virtual ~TimelineTrack() override = default;
|
||||
|
||||
void set_scale(float);
|
||||
|
||||
|
|
|
@ -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 @@ TimelineView::TimelineView(Profile& profile)
|
|||
set_shrink_to_fit(true);
|
||||
}
|
||||
|
||||
TimelineView::~TimelineView()
|
||||
{
|
||||
}
|
||||
|
||||
u64 TimelineView::timestamp_at_x(int x) const
|
||||
{
|
||||
float column_width = (float)width() / (float)m_profile.length_in_ms();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -17,7 +18,7 @@ class TimelineView final : public GUI::Widget {
|
|||
C_OBJECT(TimelineView);
|
||||
|
||||
public:
|
||||
virtual ~TimelineView() override;
|
||||
virtual ~TimelineView() override = default;
|
||||
|
||||
Function<void()> on_selection_change;
|
||||
Function<void()> on_scale_change;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue