mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:17:44 +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, Itamar S. <itamar8910@gmail.com>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -32,8 +33,4 @@ CodeDocument::CodeDocument(Client* client)
|
|||
{
|
||||
}
|
||||
|
||||
CodeDocument::~CodeDocument()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -14,7 +15,7 @@ namespace HackStudio {
|
|||
|
||||
class CodeDocument final : public GUI::TextDocument {
|
||||
public:
|
||||
virtual ~CodeDocument() override;
|
||||
virtual ~CodeDocument() override = default;
|
||||
static NonnullRefPtr<CodeDocument> create(const String& file_path, Client* client = nullptr);
|
||||
static NonnullRefPtr<CodeDocument> create(Client* client = nullptr);
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Matthew Olsson <matthewcolsson@gmail.com>
|
||||
* Copyright (c) 2021, Hunter Salyer <thefalsehonesty@gmail.com>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -25,10 +26,6 @@ DebuggerVariableJSObject::DebuggerVariableJSObject(const Debug::DebugInfo::Varia
|
|||
{
|
||||
}
|
||||
|
||||
DebuggerVariableJSObject::~DebuggerVariableJSObject()
|
||||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<bool> DebuggerVariableJSObject::internal_set(const JS::PropertyKey& property_key, JS::Value value, JS::Value)
|
||||
{
|
||||
auto& vm = this->vm();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Matthew Olsson <matthewcolsson@gmail.com>
|
||||
* Copyright (c) 2021, Hunter Salyer <thefalsehonesty@gmail.com>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -21,7 +22,7 @@ public:
|
|||
static DebuggerVariableJSObject* create(DebuggerGlobalJSObject&, const Debug::DebugInfo::VariableInfo& variable_info);
|
||||
|
||||
DebuggerVariableJSObject(const Debug::DebugInfo::VariableInfo& variable_info, JS::Object& prototype);
|
||||
virtual ~DebuggerVariableJSObject() override;
|
||||
virtual ~DebuggerVariableJSObject() override = default;
|
||||
|
||||
virtual const char* class_name() const override { return m_variable_info.type_name.characters(); }
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Luke Wilde <lukew@serenityos.org>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -67,10 +68,6 @@ DisassemblyModel::DisassemblyModel(const Debug::DebugSession& debug_session, con
|
|||
}
|
||||
}
|
||||
|
||||
DisassemblyModel::~DisassemblyModel()
|
||||
{
|
||||
}
|
||||
|
||||
int DisassemblyModel::row_count(const GUI::ModelIndex&) const
|
||||
{
|
||||
return m_instructions.size();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Luke Wilde <lukew@serenityos.org>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -40,7 +41,7 @@ public:
|
|||
__Count
|
||||
};
|
||||
|
||||
virtual ~DisassemblyModel() override;
|
||||
virtual ~DisassemblyModel() override = default;
|
||||
|
||||
virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override;
|
||||
virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return Column::__Count; }
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Luke Wilde <lukew@serenityos.org>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -93,10 +94,6 @@ RegistersModel::RegistersModel(const PtraceRegisters& current_regs, const Ptrace
|
|||
m_registers.append({ "gs", current_regs.gs, current_regs.gs != previous_regs.gs });
|
||||
}
|
||||
|
||||
RegistersModel::~RegistersModel()
|
||||
{
|
||||
}
|
||||
|
||||
int RegistersModel::row_count(const GUI::ModelIndex&) const
|
||||
{
|
||||
return m_registers.size();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Luke Wilde <lukew@serenityos.org>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -36,7 +37,7 @@ public:
|
|||
__Count
|
||||
};
|
||||
|
||||
virtual ~RegistersModel() override;
|
||||
virtual ~RegistersModel() override = default;
|
||||
|
||||
virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override;
|
||||
virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return Column::__Count; }
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Nick Vella <nick@nxk.io>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -101,10 +102,6 @@ NewProjectDialog::NewProjectDialog(GUI::Window* parent)
|
|||
};
|
||||
}
|
||||
|
||||
NewProjectDialog::~NewProjectDialog()
|
||||
{
|
||||
}
|
||||
|
||||
RefPtr<ProjectTemplate> NewProjectDialog::selected_template()
|
||||
{
|
||||
if (m_icon_view->selection().is_empty()) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Nick Vella <nick@nxk.io>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -27,7 +28,7 @@ public:
|
|||
|
||||
private:
|
||||
NewProjectDialog(GUI::Window* parent);
|
||||
virtual ~NewProjectDialog() override;
|
||||
virtual ~NewProjectDialog() override = default;
|
||||
|
||||
void update_dialog();
|
||||
Optional<String> get_available_project_name();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Nick Vella <nick@nxk.io>
|
||||
* Copyright (c) 2021, sin-ack <sin-ack@protonmail.com>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -42,10 +43,6 @@ ProjectTemplatesModel::ProjectTemplatesModel()
|
|||
rescan_templates();
|
||||
}
|
||||
|
||||
ProjectTemplatesModel::~ProjectTemplatesModel()
|
||||
{
|
||||
}
|
||||
|
||||
int ProjectTemplatesModel::row_count(const GUI::ModelIndex&) const
|
||||
{
|
||||
return m_mapping.size();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Nick Vella <nick@nxk.io>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -29,7 +30,7 @@ public:
|
|||
__Count
|
||||
};
|
||||
|
||||
virtual ~ProjectTemplatesModel() override;
|
||||
virtual ~ProjectTemplatesModel() override = default;
|
||||
|
||||
RefPtr<ProjectTemplate> template_for_index(const GUI::ModelIndex& index);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2018-2021, the SerenityOS developers.
|
||||
* Copyright (c) 2018-2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -79,10 +79,6 @@ Editor::Editor()
|
|||
set_gutter_visible(true);
|
||||
}
|
||||
|
||||
Editor::~Editor()
|
||||
{
|
||||
}
|
||||
|
||||
ErrorOr<void> Editor::initialize_documentation_tooltip()
|
||||
{
|
||||
m_documentation_tooltip_window = GUI::Window::construct();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2020-2022, Itamar S. <itamar8910@gmail.com>
|
||||
* Copyright (c) 2018-2021, the SerenityOS developers.
|
||||
* Copyright (c) 2018-2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -26,7 +26,7 @@ class Editor final : public GUI::TextEditor {
|
|||
public:
|
||||
static ErrorOr<NonnullRefPtr<Editor>> try_create();
|
||||
|
||||
virtual ~Editor() override;
|
||||
virtual ~Editor() override = default;
|
||||
|
||||
Function<void()> on_focus;
|
||||
Function<void(String)> on_open;
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
@ -48,10 +49,6 @@ EditorWrapper::EditorWrapper()
|
|||
};
|
||||
}
|
||||
|
||||
EditorWrapper::~EditorWrapper()
|
||||
{
|
||||
}
|
||||
|
||||
void EditorWrapper::set_editor_has_focus(Badge<Editor>, bool focus)
|
||||
{
|
||||
auto& font = Gfx::FontDatabase::default_font();
|
||||
|
|
|
@ -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,7 +25,7 @@ class EditorWrapper : public GUI::Widget {
|
|||
C_OBJECT(EditorWrapper)
|
||||
|
||||
public:
|
||||
virtual ~EditorWrapper() override;
|
||||
virtual ~EditorWrapper() override = default;
|
||||
|
||||
Editor& editor() { return *m_editor; }
|
||||
const Editor& editor() const { return *m_editor; }
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -16,10 +17,6 @@
|
|||
|
||||
namespace HackStudio {
|
||||
|
||||
DiffViewer::~DiffViewer()
|
||||
{
|
||||
}
|
||||
|
||||
void DiffViewer::paint_event(GUI::PaintEvent& event)
|
||||
{
|
||||
GUI::Painter painter(*this);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -15,7 +16,7 @@ namespace HackStudio {
|
|||
class DiffViewer final : public GUI::AbstractScrollableWidget {
|
||||
C_OBJECT(DiffViewer)
|
||||
public:
|
||||
virtual ~DiffViewer() override;
|
||||
virtual ~DiffViewer() override = default;
|
||||
|
||||
void set_content(const String& original, const String& diff);
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -11,9 +12,6 @@
|
|||
#include <LibGfx/Palette.h>
|
||||
|
||||
namespace HackStudio {
|
||||
GitFilesView::~GitFilesView()
|
||||
{
|
||||
}
|
||||
|
||||
void GitFilesView::paint_list_item(GUI::Painter& painter, int row_index, int painted_item_index)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -17,7 +18,7 @@ using GitFileActionCallback = Function<void(String const& file)>;
|
|||
class GitFilesView : public GUI::ListView {
|
||||
C_OBJECT(GitFilesView)
|
||||
public:
|
||||
virtual ~GitFilesView() override;
|
||||
virtual ~GitFilesView() override = default;
|
||||
|
||||
protected:
|
||||
GitFilesView(GitFileActionCallback, NonnullRefPtr<Gfx::Bitmap> action_icon);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
|
||||
* Copyright (c) 2020-2021, the SerenityOS developers.
|
||||
* Copyright (c) 2020-2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -20,10 +21,6 @@ ClientConnection::ClientConnection(NonnullOwnPtr<Core::Stream::LocalSocket> sock
|
|||
s_connections.set(1, *this);
|
||||
}
|
||||
|
||||
ClientConnection::~ClientConnection()
|
||||
{
|
||||
}
|
||||
|
||||
void ClientConnection::die()
|
||||
{
|
||||
s_connections.remove(client_id());
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -21,7 +22,7 @@ namespace LanguageServers {
|
|||
class ClientConnection : public IPC::ClientConnection<LanguageClientEndpoint, LanguageServerEndpoint> {
|
||||
public:
|
||||
explicit ClientConnection(NonnullOwnPtr<Core::Stream::LocalSocket>);
|
||||
~ClientConnection() override;
|
||||
~ClientConnection() override = default;
|
||||
|
||||
virtual void die() override;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Itamar S. <itamar8910@gmail.com>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -14,9 +15,6 @@ CodeComprehensionEngine::CodeComprehensionEngine(const FileDB& filedb, bool shou
|
|||
{
|
||||
}
|
||||
|
||||
CodeComprehensionEngine::~CodeComprehensionEngine()
|
||||
{
|
||||
}
|
||||
void CodeComprehensionEngine::set_declarations_of_document(const String& filename, Vector<GUI::AutocompleteProvider::Declaration>&& declarations)
|
||||
{
|
||||
// Callback may not be configured if we're running tests
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Itamar S. <itamar8910@gmail.com>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -18,7 +19,7 @@ class ClientConnection;
|
|||
class CodeComprehensionEngine {
|
||||
public:
|
||||
CodeComprehensionEngine(const FileDB& filedb, bool store_all_declarations = false);
|
||||
virtual ~CodeComprehensionEngine();
|
||||
virtual ~CodeComprehensionEngine() = default;
|
||||
|
||||
virtual Vector<GUI::AutocompleteProvider::Entry> get_suggestions(const String& file, const GUI::TextPosition& autocomplete_position) = 0;
|
||||
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
@ -157,10 +158,6 @@ Locator::Locator(Core::Object* parent)
|
|||
};
|
||||
}
|
||||
|
||||
Locator::~Locator()
|
||||
{
|
||||
}
|
||||
|
||||
void Locator::open_suggestion(const GUI::ModelIndex& index)
|
||||
{
|
||||
auto& model = reinterpret_cast<LocatorSuggestionModel&>(*m_suggestion_view->model());
|
||||
|
|
|
@ -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 HackStudio {
|
|||
class Locator final : public GUI::Widget {
|
||||
C_OBJECT(Locator)
|
||||
public:
|
||||
virtual ~Locator() override;
|
||||
virtual ~Locator() override = default;
|
||||
|
||||
void open();
|
||||
void close();
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
@ -203,10 +204,6 @@ TerminalWrapper::TerminalWrapper(bool user_spawned)
|
|||
run_command("Shell");
|
||||
}
|
||||
|
||||
TerminalWrapper::~TerminalWrapper()
|
||||
{
|
||||
}
|
||||
|
||||
int TerminalWrapper::child_exit_status() const
|
||||
{
|
||||
VERIFY(m_child_exit_status.has_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
|
||||
*/
|
||||
|
@ -15,7 +16,7 @@ namespace HackStudio {
|
|||
class TerminalWrapper final : public GUI::Widget {
|
||||
C_OBJECT(TerminalWrapper)
|
||||
public:
|
||||
virtual ~TerminalWrapper() override;
|
||||
virtual ~TerminalWrapper() override = default;
|
||||
enum class WaitForExit {
|
||||
No,
|
||||
Yes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue