Commit a169c5e8 authored by Ahmad Samir's avatar Ahmad Samir Committed by Christoph Cullmann
Browse files

Snippets: manage a member pointer with a unique_ptr

Less explicit new/delete.
parent 8de8ebb1
Pipeline #87431 passed with stage
in 3 minutes and 26 seconds
......@@ -47,7 +47,7 @@ KTextEditor::View *createView(QWidget *tabWidget)
EditSnippet::EditSnippet(SnippetRepository *repository, Snippet *snippet, QWidget *parent)
: QDialog(parent)
, m_ui(new Ui::EditSnippetBase)
, m_ui(std::make_unique<Ui::EditSnippetBase>())
, m_repo(repository)
, m_snippet(snippet)
, m_topBoxModified(false)
......@@ -131,10 +131,7 @@ void EditSnippet::test()
m_testView->setFocus();
}
EditSnippet::~EditSnippet()
{
delete m_ui;
}
EditSnippet::~EditSnippet() = default;
void EditSnippet::setSnippetText(const QString &text)
{
......
......@@ -13,6 +13,8 @@
#include <QDialog>
#include <memory>
namespace KTextEditor
{
class View;
......@@ -45,7 +47,7 @@ public:
void reject() override;
private:
Ui::EditSnippetBase *m_ui;
std::unique_ptr<Ui::EditSnippetBase> const m_ui;
SnippetRepository *m_repo;
Snippet *m_snippet;
KTextEditor::View *m_snippetView;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment