Don't use new in convertchecker

This commit is contained in:
Anton Thomasson 2021-06-12 17:09:56 +02:00
parent 4e8692c431
commit 04bf472ff8

View file

@ -7,34 +7,31 @@ ConvertChecker::ConvertChecker()
{ {
_pdf = false; _pdf = false;
_calligra = false; _calligra = false;
QProcess* pdftoppm = new QProcess(this); QProcess pdftoppm(this);
pdftoppm->setProgram("pdftoppm"); pdftoppm.setProgram("pdftoppm");
pdftoppm->setArguments({"-h"}); pdftoppm.setArguments({"-h"});
pdftoppm->start(); pdftoppm.start();
QProcess* calligraconverter = new QProcess(this); QProcess calligraconverter(this);
calligraconverter->setProgram("calligraconverter"); calligraconverter.setProgram("calligraconverter");
calligraconverter->setArguments({"-h"}); calligraconverter.setArguments({"-h"});
calligraconverter->start(); calligraconverter.start();
if(pdftoppm->waitForFinished(2000)) if(pdftoppm.waitForFinished(2000))
{ {
if(pdftoppm->exitStatus() == QProcess::NormalExit && pdftoppm->exitCode() == 0) if(pdftoppm.exitStatus() == QProcess::NormalExit && pdftoppm.exitCode() == 0)
{ {
_pdf = true; _pdf = true;
} }
} }
if(calligraconverter->waitForFinished(2000)) if(calligraconverter.waitForFinished(2000))
{ {
if(calligraconverter->exitStatus() == QProcess::NormalExit && calligraconverter->exitCode() == 0) if(calligraconverter.exitStatus() == QProcess::NormalExit && calligraconverter.exitCode() == 0)
{ {
_calligra = true; _calligra = true;
} }
} }
pdftoppm->deleteLater();
calligraconverter->deleteLater();
} }
ConvertChecker::~ConvertChecker() { ConvertChecker::~ConvertChecker() {