forked from qt-creator/qt-creator
ClangTools: Use std::unique_ptr in DiagnosticView
Change-Id: Iee8faf18178b6190b4d8b2bc2816ea00d680bd3f Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -178,22 +178,18 @@ private:
|
|||||||
DiagnosticView::DiagnosticView(QWidget *parent)
|
DiagnosticView::DiagnosticView(QWidget *parent)
|
||||||
: Debugger::DetailedErrorView(parent)
|
: Debugger::DetailedErrorView(parent)
|
||||||
, m_style(new DiagnosticViewStyle)
|
, m_style(new DiagnosticViewStyle)
|
||||||
, m_delegate(new DiagnosticViewDelegate(m_style))
|
, m_delegate(new DiagnosticViewDelegate(m_style.get()))
|
||||||
{
|
{
|
||||||
m_suppressAction = new QAction(tr("Suppress This Diagnostic"), this);
|
m_suppressAction = new QAction(tr("Suppress This Diagnostic"), this);
|
||||||
connect(m_suppressAction, &QAction::triggered,
|
connect(m_suppressAction, &QAction::triggered,
|
||||||
this, &DiagnosticView::suppressCurrentDiagnostic);
|
this, &DiagnosticView::suppressCurrentDiagnostic);
|
||||||
installEventFilter(this);
|
installEventFilter(this);
|
||||||
|
|
||||||
setStyle(m_style);
|
setStyle(m_style.get());
|
||||||
setItemDelegate(m_delegate);
|
setItemDelegate(m_delegate.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
DiagnosticView::~DiagnosticView()
|
DiagnosticView::~DiagnosticView() = default;
|
||||||
{
|
|
||||||
delete m_delegate;
|
|
||||||
delete m_style;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DiagnosticView::suppressCurrentDiagnostic()
|
void DiagnosticView::suppressCurrentDiagnostic()
|
||||||
{
|
{
|
||||||
|
@@ -27,6 +27,8 @@
|
|||||||
|
|
||||||
#include <debugger/analyzer/detailederrorview.h>
|
#include <debugger/analyzer/detailederrorview.h>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
namespace ClangTools {
|
namespace ClangTools {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -59,8 +61,8 @@ private:
|
|||||||
void setModel(QAbstractItemModel *theProxyModel) override;
|
void setModel(QAbstractItemModel *theProxyModel) override;
|
||||||
|
|
||||||
QAction *m_suppressAction;
|
QAction *m_suppressAction;
|
||||||
DiagnosticViewStyle *m_style = nullptr;
|
std::unique_ptr<DiagnosticViewStyle> m_style;
|
||||||
DiagnosticViewDelegate *m_delegate = nullptr;
|
std::unique_ptr<DiagnosticViewDelegate> m_delegate;
|
||||||
bool m_ignoreSetSelectedFixItsCount = false;
|
bool m_ignoreSetSelectedFixItsCount = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user