CProjectSettingsDialog: Make use of in-class initializers where applicable

This commit is contained in:
Lioncash 2020-06-28 04:40:02 -04:00
parent 152d638f7a
commit 2b19b7584d
2 changed files with 8 additions and 10 deletions

View File

@ -20,8 +20,7 @@
CProjectSettingsDialog::CProjectSettingsDialog(QWidget *pParent) CProjectSettingsDialog::CProjectSettingsDialog(QWidget *pParent)
: QDialog(pParent) : QDialog(pParent)
, mpUI(new Ui::CProjectSettingsDialog) , mpUI(std::make_unique<Ui::CProjectSettingsDialog>())
, mpProject(nullptr)
{ {
mpUI->setupUi(this); mpUI->setupUi(this);
@ -42,10 +41,7 @@ CProjectSettingsDialog::CProjectSettingsDialog(QWidget *pParent)
mpUI->BuildIsoButton->setPalette(Palette); mpUI->BuildIsoButton->setPalette(Palette);
} }
CProjectSettingsDialog::~CProjectSettingsDialog() CProjectSettingsDialog::~CProjectSettingsDialog() = default;
{
delete mpUI;
}
void CProjectSettingsDialog::ActiveProjectChanged(CGameProject *pProj) void CProjectSettingsDialog::ActiveProjectChanged(CGameProject *pProj)
{ {

View File

@ -6,6 +6,8 @@
#include <Core/Resource/CWorld.h> #include <Core/Resource/CWorld.h>
#include <QDialog> #include <QDialog>
#include <memory>
namespace Ui { namespace Ui {
class CProjectSettingsDialog; class CProjectSettingsDialog;
} }
@ -13,16 +15,16 @@ class CProjectSettingsDialog;
class CProjectSettingsDialog : public QDialog class CProjectSettingsDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
Ui::CProjectSettingsDialog *mpUI; std::unique_ptr<Ui::CProjectSettingsDialog> mpUI;
CGameProject *mpProject; CGameProject *mpProject = nullptr;
QVector<CResourceEntry*> mWorldEntries; QVector<CResourceEntry*> mWorldEntries;
QVector<CResourceEntry*> mAreaEntries; QVector<CResourceEntry*> mAreaEntries;
TResPtr<CWorld> mpWorld; TResPtr<CWorld> mpWorld;
public: public:
explicit CProjectSettingsDialog(QWidget *pParent = 0); explicit CProjectSettingsDialog(QWidget *pParent = nullptr);
~CProjectSettingsDialog(); ~CProjectSettingsDialog() override;
public slots: public slots:
void ActiveProjectChanged(CGameProject *pProj); void ActiveProjectChanged(CGameProject *pProj);