work on smart pointer transition of musrWiz.

This commit is contained in:
2023-10-22 18:03:31 +02:00
parent 088a35cb23
commit 64a5260874
3 changed files with 149 additions and 137 deletions

View File

@@ -1,5 +1,6 @@
#include <iostream>
#include <fstream>
#include <memory>
#include <QApplication>
#include <QProcess>
@@ -83,16 +84,18 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
PAdmin *admin = new PAdmin();
std::unique_ptr<PAdmin> admin = std::make_unique<PAdmin>();
if (admin == nullptr) {
return 1;
}
if (!admin->IsValid()) {
delete admin;
return 1;
}
admin->dump(dump);
PMsrData *info = new PMsrData(); // this content will eventually be set by the xml-handler
std::unique_ptr<PMsrData> info = std::make_unique<PMsrData>(); // this content will eventually be set by the xml-handler
PMusrWiz wizard(admin, info);
PMusrWiz wizard(admin.get(), info.get());
wizard.show();
app.exec();
@@ -138,10 +141,5 @@ int main(int argc, char *argv[])
}
}
if (info)
delete info;
if (admin)
delete admin;
return result;
}