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;
_calligra = false;
QProcess* pdftoppm = new QProcess(this);
pdftoppm->setProgram("pdftoppm");
pdftoppm->setArguments({"-h"});
pdftoppm->start();
QProcess pdftoppm(this);
pdftoppm.setProgram("pdftoppm");
pdftoppm.setArguments({"-h"});
pdftoppm.start();
QProcess* calligraconverter = new QProcess(this);
calligraconverter->setProgram("calligraconverter");
calligraconverter->setArguments({"-h"});
calligraconverter->start();
QProcess calligraconverter(this);
calligraconverter.setProgram("calligraconverter");
calligraconverter.setArguments({"-h"});
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;
}
}
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;
}
}
pdftoppm->deleteLater();
calligraconverter->deleteLater();
}
ConvertChecker::~ConvertChecker() {