start replacing raw to smart pointers for mupp.

This commit is contained in:
2023-10-23 20:32:01 +02:00
parent 302f5cd5ca
commit afbe8a8ee6
4 changed files with 115 additions and 138 deletions

View File

@@ -49,31 +49,14 @@
PmuppScript::PmuppScript(QStringList script) :
fScript(script)
{
fParamDataHandler = 0;
fLoadPath = QString("./");
fSavePath = QString("./");
fSelected = -2; // nothing selected
fNorm = false;
fAdmin = new PmuppAdmin();
fAdmin = std::make_unique<PmuppAdmin>();
}
//--------------------------------------------------------------------------
/**
* @brief PmuppScript::~PmuppScript. Dtor
*/
PmuppScript::~PmuppScript()
{
if (fParamDataHandler) {
delete fParamDataHandler;
fParamDataHandler = 0;
}
if (fAdmin) {
delete fAdmin;
fAdmin = 0;
}
}
//--------------------------------------------------------------------------
/**
* @brief PmuppScript::executeScript. Handles the script commands.
@@ -81,8 +64,8 @@ PmuppScript::~PmuppScript()
*/
int PmuppScript::executeScript()
{
fParamDataHandler = new PParamDataHandler();
if (fParamDataHandler == 0) {
fParamDataHandler = std::make_unique<PParamDataHandler>();
if (fParamDataHandler == nullptr) {
std::cerr << std::endl << "**ERROR** couldn't invoke data handler ..." << std::endl << std::endl;
return -1;
}