diff --git a/src/Editor/CGeneratePropertyNamesDialog.cpp b/src/Editor/CGeneratePropertyNamesDialog.cpp index 7d0681d2..10d4e6e5 100644 --- a/src/Editor/CGeneratePropertyNamesDialog.cpp +++ b/src/Editor/CGeneratePropertyNamesDialog.cpp @@ -10,10 +10,8 @@ CGeneratePropertyNamesDialog::CGeneratePropertyNamesDialog(QWidget* pParent) : QDialog(pParent) - , mpUI( new Ui::CGeneratePropertyNamesDialog ) - , mFutureWatcher( this ) - , mRunningNameGeneration( false ) - , mCanceledNameGeneration( false ) + , mpUI(std::make_unique()) + , mFutureWatcher(this) { mpUI->setupUi(this); mNotifier.SetProgressBar( mpUI->ProgressBar ); @@ -41,10 +39,7 @@ CGeneratePropertyNamesDialog::CGeneratePropertyNamesDialog(QWidget* pParent) QtConcurrent::run(&mGenerator, &CPropertyNameGenerator::Warmup); } -CGeneratePropertyNamesDialog::~CGeneratePropertyNamesDialog() -{ - delete mpUI; -} +CGeneratePropertyNamesDialog::~CGeneratePropertyNamesDialog() = default; /** Add a property to the ID pool */ void CGeneratePropertyNamesDialog::AddToIDPool(IProperty* pProperty) diff --git a/src/Editor/CGeneratePropertyNamesDialog.h b/src/Editor/CGeneratePropertyNamesDialog.h index 62b2393f..26821dbf 100644 --- a/src/Editor/CGeneratePropertyNamesDialog.h +++ b/src/Editor/CGeneratePropertyNamesDialog.h @@ -13,6 +13,7 @@ #include #include #include +#include using CNameCasingComboBox = TEnumComboBox; @@ -26,7 +27,7 @@ class CGeneratePropertyNamesDialog; class CGeneratePropertyNamesDialog : public QDialog { Q_OBJECT - Ui::CGeneratePropertyNamesDialog* mpUI; + std::unique_ptr mpUI; /** The name generator */ CPropertyNameGenerator mGenerator; @@ -51,13 +52,13 @@ class CGeneratePropertyNamesDialog : public QDialog QVector mCheckedItems; /** Whether name generation is running */ - bool mRunningNameGeneration; + bool mRunningNameGeneration = false; /** Whether name generation has been canceled */ - bool mCanceledNameGeneration; + bool mCanceledNameGeneration = false; public: - explicit CGeneratePropertyNamesDialog(QWidget *pParent = 0); + explicit CGeneratePropertyNamesDialog(QWidget *pParent = nullptr); ~CGeneratePropertyNamesDialog(); /** Add a property to the ID pool */ @@ -71,10 +72,10 @@ public: public slots: /** Show event override */ - virtual void showEvent(QShowEvent* pEvent); + void showEvent(QShowEvent* pEvent) override; /** Close event override */ - virtual void closeEvent(QCloseEvent* pEvent); + void closeEvent(QCloseEvent* pEvent) override; /** Add an item to the suffix list */ void AddSuffix();