CWorldInfoSidebar: Make use of in-class initializers where applicable

This commit is contained in:
Lioncash 2020-06-28 06:27:16 -04:00
parent 548e4ca708
commit 9b2bfd5bcd
2 changed files with 6 additions and 7 deletions

View File

@ -5,7 +5,7 @@
CWorldInfoSidebar::CWorldInfoSidebar(CWorldEditor *pEditor)
: CWorldEditorSidebar(pEditor)
, mpUI(new Ui::CWorldInfoSidebar)
, mpUI(std::make_unique<Ui::CWorldInfoSidebar>())
, mModel(pEditor)
{
mpUI->setupUi(this);
@ -45,10 +45,7 @@ CWorldInfoSidebar::CWorldInfoSidebar(CWorldEditor *pEditor)
mpUI->AreaNameSelector->SetEditable(false);
}
CWorldInfoSidebar::~CWorldInfoSidebar()
{
delete mpUI;
}
CWorldInfoSidebar::~CWorldInfoSidebar() = default;
// ************ SLOTS ************
void CWorldInfoSidebar::OnActiveProjectChanged(CGameProject *pProj)

View File

@ -6,6 +6,8 @@
#include "CWorldEditorSidebar.h"
#include "CWorldTreeModel.h"
#include <memory>
class CWorldEditor;
namespace Ui {
@ -16,13 +18,13 @@ class CWorldInfoSidebar : public CWorldEditorSidebar
{
Q_OBJECT
Ui::CWorldInfoSidebar *mpUI;
std::unique_ptr<Ui::CWorldInfoSidebar> mpUI;
CWorldTreeModel mModel;
CWorldTreeProxyModel mProxyModel;
public:
explicit CWorldInfoSidebar(CWorldEditor *pEditor);
~CWorldInfoSidebar();
~CWorldInfoSidebar() override;
public slots:
void OnActiveProjectChanged(CGameProject *pProj);