Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Ark
Commits
aa90d817
Commit
aa90d817
authored
Dec 10, 2021
by
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
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
kerfuffle/jobs.cpp
View file @
aa90d817
...
...
@@ -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
);
});
...
...
kerfuffle/jobs.h
View file @
aa90d817
...
...
@@ -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.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment