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)
|
||||
: Debugger::DetailedErrorView(parent)
|
||||
, 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);
|
||||
connect(m_suppressAction, &QAction::triggered,
|
||||
this, &DiagnosticView::suppressCurrentDiagnostic);
|
||||
installEventFilter(this);
|
||||
|
||||
setStyle(m_style);
|
||||
setItemDelegate(m_delegate);
|
||||
setStyle(m_style.get());
|
||||
setItemDelegate(m_delegate.get());
|
||||
}
|
||||
|
||||
DiagnosticView::~DiagnosticView()
|
||||
{
|
||||
delete m_delegate;
|
||||
delete m_style;
|
||||
}
|
||||
DiagnosticView::~DiagnosticView() = default;
|
||||
|
||||
void DiagnosticView::suppressCurrentDiagnostic()
|
||||
{
|
||||
|
@@ -27,6 +27,8 @@
|
||||
|
||||
#include <debugger/analyzer/detailederrorview.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
|
||||
@@ -59,8 +61,8 @@ private:
|
||||
void setModel(QAbstractItemModel *theProxyModel) override;
|
||||
|
||||
QAction *m_suppressAction;
|
||||
DiagnosticViewStyle *m_style = nullptr;
|
||||
DiagnosticViewDelegate *m_delegate = nullptr;
|
||||
std::unique_ptr<DiagnosticViewStyle> m_style;
|
||||
std::unique_ptr<DiagnosticViewDelegate> m_delegate;
|
||||
bool m_ignoreSetSelectedFixItsCount = false;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user