summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElvis Angelaccio <elvis.angelaccio@kde.org>2016-09-29 08:37:11 (GMT)
committerElvis Angelaccio <elvis.angelaccio@kde.org>2016-09-29 08:37:11 (GMT)
commitb4685c6698cc683db0166d3423ffe989ff5538f3 (patch)
treeed0137240d5d62f631b5f6ed434e4b24e86fbe2c
parent4c77272c6fc5f9eead93b25e3a3e391bb5e84b86 (diff)
Properly unregister BatchExtract jobs
This fixes a warning when rejecting the extraction dialog open by 'ark --batch --dialog'
-rw-r--r--app/batchextract.cpp6
-rw-r--r--app/batchextract.h1
2 files changed, 5 insertions, 2 deletions
diff --git a/app/batchextract.cpp b/app/batchextract.cpp
index f14a70a..c3d755d 100644
--- a/app/batchextract.cpp
+++ b/app/batchextract.cpp
@@ -49,7 +49,8 @@ BatchExtract::BatchExtract(QObject* parent)
: KCompositeJob(parent),
m_autoSubfolder(false),
m_preservePaths(true),
- m_openDestinationAfterExtraction(false)
+ m_openDestinationAfterExtraction(false),
+ m_registered(false)
{
setCapabilities(KJob::Killable);
@@ -58,7 +59,7 @@ BatchExtract::BatchExtract(QObject* parent)
BatchExtract::~BatchExtract()
{
- if (!m_inputs.isEmpty()) {
+ if (m_registered) {
KIO::getJobTracker()->unregisterJob(this);
}
}
@@ -139,6 +140,7 @@ void BatchExtract::slotStartJob()
}
KIO::getJobTracker()->registerJob(this);
+ m_registered = true;
emit description(this,
i18n("Extracting Files"),
diff --git a/app/batchextract.h b/app/batchextract.h
index cbfc338..ff0ae8e 100644
--- a/app/batchextract.h
+++ b/app/batchextract.h
@@ -225,6 +225,7 @@ private:
QStringList m_failedFiles;
bool m_preservePaths;
bool m_openDestinationAfterExtraction;
+ bool m_registered;
};
#endif // BATCHEXTRACT_H