CQuickplayPropertyEditor: Make use of in-class initializers where applicable

This commit is contained in:
Lioncash 2020-06-28 05:01:00 -04:00
parent 7e44839404
commit 8ae17a9f1b
2 changed files with 9 additions and 10 deletions

View File

@ -9,9 +9,9 @@
class CDolphinValidator : public QValidator
{
public:
CDolphinValidator(QObject* pParent = 0) : QValidator(pParent) {}
explicit CDolphinValidator(QObject* pParent = nullptr) : QValidator(pParent) {}
virtual QValidator::State validate(QString& Input, int& Pos) const override
QValidator::State validate(QString& Input, int& Pos) const override
{
return PathValid(Input) ? QValidator::Acceptable : QValidator::Invalid;
}
@ -26,7 +26,7 @@ public:
/** CQuickplayPropertyEditor functions */
CQuickplayPropertyEditor::CQuickplayPropertyEditor(SQuickplayParameters& Parameters, QWidget* pParent /*= 0*/)
: QMenu(pParent)
, mpUI(new Ui::CQuickplayPropertyEditor)
, mpUI(std::make_unique<Ui::CQuickplayPropertyEditor>())
, mParameters(Parameters)
{
mpUI->setupUi(this);
@ -67,10 +67,7 @@ CQuickplayPropertyEditor::CQuickplayPropertyEditor(SQuickplayParameters& Paramet
}
}
CQuickplayPropertyEditor::~CQuickplayPropertyEditor()
{
delete mpUI;
}
CQuickplayPropertyEditor::~CQuickplayPropertyEditor() = default;
void CQuickplayPropertyEditor::BrowseForDolphin()
{

View File

@ -8,6 +8,8 @@
#include <Core/Resource/CWorld.h>
#include <Core/Resource/Area/CGameArea.h>
#include <memory>
namespace Ui {
class CQuickplayPropertyEditor;
}
@ -19,12 +21,12 @@ class CQuickplayPropertyEditor : public QMenu
{
Q_OBJECT
Ui::CQuickplayPropertyEditor* mpUI;
std::unique_ptr<Ui::CQuickplayPropertyEditor> mpUI;
SQuickplayParameters& mParameters;
public:
CQuickplayPropertyEditor(SQuickplayParameters& Parameters, QWidget* pParent = 0);
~CQuickplayPropertyEditor();
explicit CQuickplayPropertyEditor(SQuickplayParameters& Parameters, QWidget* pParent = nullptr);
~CQuickplayPropertyEditor() override;
public slots:
void BrowseForDolphin();