Commit f9f71649 authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

Stop killing extraction/compression jobs when dolphin quits

BUG: 459346
FIXED-IN: 22.08.2
parent e67ea2a5
Pipeline #238106 passed with stage
in 1 minute and 23 seconds
......@@ -100,7 +100,8 @@ QAction *CompressFileItemAction::createAction(const QIcon &icon, QWidget *parent
QAction *action = new QAction(icon, name, parent);
connect(action, &QAction::triggered, this, [fileExtension, urls, name, parent, this]() {
auto *addToArchiveJob = new AddToArchive(parent);
// Don't pass a parent to the job, otherwise it will be killed if dolphin gets closed.
auto *addToArchiveJob = new AddToArchive(nullptr);
addToArchiveJob->setImmediateProgressReporting(true);
addToArchiveJob->setChangeToFirstPath(true);
for (const QUrl &url : urls) {
......@@ -121,6 +122,7 @@ QAction *CompressFileItemAction::createAction(const QIcon &icon, QWidget *parent
} else if (!addToArchiveJob->errorString().isEmpty()) {
Q_EMIT error(addToArchiveJob->errorString());
}
addToArchiveJob->deleteLater();
});
});
......
......@@ -100,7 +100,8 @@ QAction *ExtractFileItemAction::createAction(const QIcon& icon, const QString& n
{
QAction *action = new QAction(icon, name, parent);
connect(action, &QAction::triggered, this, [urls,name, option, parent,this]() {
auto *batchExtractJob = new BatchExtract(parent);
// Don't pass a parent to the job, otherwise it will be killed if dolphin gets closed.
auto *batchExtractJob = new BatchExtract(nullptr);
batchExtractJob->setDestinationFolder(QFileInfo(urls.first().toLocalFile()).path());
batchExtractJob->setOpenDestinationAfterExtraction(ArkSettings::openDestinationFolderAfterExtraction());
if (option == AutoSubfolder) {
......@@ -119,6 +120,7 @@ QAction *ExtractFileItemAction::createAction(const QIcon& icon, const QString& n
if (!batchExtractJob->errorString().isEmpty()) {
Q_EMIT error(batchExtractJob->errorString());
}
batchExtractJob->deleteLater();
});
});
return action;
......
Supports Markdown
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