CScanEditor: Make use of in-class initializers where applicable
This commit is contained in:
parent
8c4e16d51e
commit
145dc11c58
|
@ -1,9 +1,9 @@
|
|||
#include "CScanEditor.h"
|
||||
#include "ui_CScanEditor.h"
|
||||
|
||||
CScanEditor::CScanEditor(CScan* pScan, QWidget* pParent /*= 0*/)
|
||||
CScanEditor::CScanEditor(CScan* pScan, QWidget* pParent)
|
||||
: IEditor(pParent)
|
||||
, mpUI(new Ui::CScanEditor)
|
||||
, mpUI(std::make_unique<Ui::CScanEditor>())
|
||||
, mpScan(pScan)
|
||||
{
|
||||
mpUI->setupUi(this);
|
||||
|
@ -19,10 +19,7 @@ CScanEditor::CScanEditor(CScan* pScan, QWidget* pParent /*= 0*/)
|
|||
connect( mpUI->ActionSaveAndCook, SIGNAL(toggled(bool)), this, SLOT(SaveAndRepack()) );
|
||||
}
|
||||
|
||||
CScanEditor::~CScanEditor()
|
||||
{
|
||||
delete mpUI;
|
||||
}
|
||||
CScanEditor::~CScanEditor() = default;
|
||||
|
||||
bool CScanEditor::Save()
|
||||
{
|
||||
|
@ -32,6 +29,6 @@ bool CScanEditor::Save()
|
|||
setWindowModified(false);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
#include "Editor/IEditor.h"
|
||||
#include <Core/Resource/Scan/CScan.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace Ui {
|
||||
class CScanEditor;
|
||||
}
|
||||
|
@ -13,17 +15,17 @@ class CScanEditor : public IEditor
|
|||
Q_OBJECT
|
||||
|
||||
/** Qt UI */
|
||||
Ui::CScanEditor* mpUI;
|
||||
std::unique_ptr<Ui::CScanEditor> mpUI;
|
||||
|
||||
/** Scan asset being edited */
|
||||
TResPtr<CScan> mpScan;
|
||||
|
||||
public:
|
||||
explicit CScanEditor(CScan* pScan, QWidget* pParent = 0);
|
||||
~CScanEditor();
|
||||
explicit CScanEditor(CScan* pScan, QWidget* pParent = nullptr);
|
||||
~CScanEditor() override;
|
||||
|
||||
public slots:
|
||||
virtual bool Save() override;
|
||||
bool Save() override;
|
||||
};
|
||||
|
||||
#endif // CSCANEDITOR_H
|
||||
|
|
Loading…
Reference in New Issue