Commit aa90d817 authored by Méven Car's avatar Méven Car
Browse files

Kerfuffle CreateJob: delete addJob in dtor

BUG: 443540
parent 75bf5757
Pipeline #108038 passed with stage
in 3 minutes and 3 seconds
......@@ -452,6 +452,11 @@ CreateJob::CreateJob(Archive *archive, const QVector<Archive::Entry*> &entries,
qCDebug(ARK) << "Created job instance";
}
CreateJob::~CreateJob()
{
delete m_addJob;
}
void CreateJob::enableEncryption(const QString &password, bool encryptHeader)
{
archive()->encrypt(password, encryptHeader);
......@@ -470,10 +475,9 @@ void CreateJob::doWork()
if (m_addJob) {
connect(m_addJob, &KJob::result, this, &CreateJob::emitResult);
// as autoDelete doesn't work for jobs outside of a QEventLoop
connect(m_addJob, &KJob::finished, this, [this] {delete m_addJob;});
// Forward description signal from AddJob, we need to change the first argument ('this' needs to be a CreateJob).
connect(m_addJob, &KJob::description, this, [=](KJob *, const QString &title, const QPair<QString,QString> &field1, const QPair<QString,QString> &) {
// Forward description signal from AddJob, we need to change the first
// argument ('this' needs to be a CreateJob).
connect(m_addJob, &KJob::description, this, [=](KJob *, const QString &title, const QPair<QString, QString> &field1, const QPair<QString, QString> &) {
Q_EMIT description(this, title, field1);
});
......
......@@ -179,6 +179,7 @@ class KERFUFFLE_EXPORT CreateJob : public Job
public:
explicit CreateJob(Archive *archive, const QVector<Archive::Entry*> &entries, const CompressionOptions& options);
~CreateJob();
/**
* @param password The password to encrypt the archive with.
* @param encryptHeader Whether to encrypt also the list of files.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment