summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Heinecke <[email protected]>2016-04-25 14:04:22 +0200
committerAndre Heinecke <[email protected]>2016-04-25 14:04:22 +0200
commitc51963aaf50e3efaf2163e739b5c7f1f8d41011a (patch)
tree9d7cf7d9883cf0cc9698f0c86e775061ef6932bc
parent7692fc362dd2dc3abfb323f76956e8995979ce3a (diff)
Remove option to delete input data
While there is a usecase for this feature secure deletion of confidential data is out of scope for Kleopatra. The removal feature was cause for critical data loss bugs (e.g. GnuPG-Bug-Id 1624 ) in the past and we can't be sure that we will always properly detect errors in Kleopatra.
-rw-r--r--src/crypto/gui/newsignencryptfileswizard.cpp31
-rw-r--r--src/crypto/gui/newsignencryptfileswizard.h1
-rw-r--r--src/crypto/gui/signencryptwizard.cpp10
-rw-r--r--src/crypto/gui/signerresolvepage.cpp15
-rw-r--r--src/crypto/gui/signerresolvepage.h3
-rw-r--r--src/crypto/signencryptfilescontroller.cpp23
-rw-r--r--src/crypto/signencryptfilestask.cpp50
-rw-r--r--src/crypto/signencryptfilestask.h1
8 files changed, 22 insertions, 112 deletions
diff --git a/src/crypto/gui/newsignencryptfileswizard.cpp b/src/crypto/gui/newsignencryptfileswizard.cpp
index 8dc19b1..662385c 100644
--- a/src/crypto/gui/newsignencryptfileswizard.cpp
+++ b/src/crypto/gui/newsignencryptfileswizard.cpp
@@ -315,11 +315,6 @@ public:
return field(p == OpenPGP ? QStringLiteral("archive-name-pgp") : QStringLiteral("archive-name-cms")).toString();
}
- bool isRemoveUnencryptedFilesEnabled() const
- {
- return field(QStringLiteral("remove")).toBool();
- }
-
bool isSignOnlySelected() const
{
return field(QStringLiteral("sign")).toBool();
@@ -398,7 +393,6 @@ public:
m_encrypt(i18n("Encrypt"), this),
m_sign(i18n("Sign"), this),
m_armor(i18n("Text output (ASCII armor)"), this),
- m_removeSource(i18n("Remove unencrypted original file when done"), this),
m_signingUserMutable(true),
m_encryptionUserMutable(true),
m_archiveUserMutable(true),
@@ -420,7 +414,6 @@ public:
KDAB_SET_OBJECT_NAME(m_archiveNameCmsLB);
KDAB_SET_OBJECT_NAME(m_archiveNameCms);
KDAB_SET_OBJECT_NAME(m_armor);
- KDAB_SET_OBJECT_NAME(m_removeSource);
QGridLayout *glay = new QGridLayout;
glay->addWidget(&m_archiveCB, 0, 0);
@@ -438,7 +431,6 @@ public:
vlay->addWidget(&m_sign);
vlay->addStretch(1);
vlay->addWidget(&m_armor);
- vlay->addWidget(&m_removeSource);
m_archiveNamePgpLB.setAlignment(Qt::AlignRight);
m_archiveNamePgpLB.setBuddy(&m_archiveNamePgp);
@@ -466,7 +458,6 @@ public:
registerField(QStringLiteral("sign"), &m_sign);
registerField(QStringLiteral("armor"), &m_armor);
- registerField(QStringLiteral("remove"), &m_removeSource);
registerField(QStringLiteral("archive"), &m_archiveCB);
registerField(QStringLiteral("archive-id"), &m_archive);
@@ -487,8 +478,6 @@ public:
connect(&m_archiveNamePgp, &FileNameRequester::fileNameChanged, this, &QWizardPage::completeChanged);
connect(&m_archiveNameCms, &FileNameRequester::fileNameChanged, this, &QWizardPage::completeChanged);
- connect(&m_sign, &QAbstractButton::toggled,
- &m_removeSource, &QWidget::setDisabled);
connect(&m_archiveCB, &QAbstractButton::toggled,
&m_archive, &QWidget::setEnabled);
connect(&m_archiveCB, &QAbstractButton::toggled,
@@ -680,7 +669,7 @@ private:
QLabel m_archiveNameCmsLB;
ArchiveFileNameRequester m_archiveNameCms;
QRadioButton m_signencrypt, m_encrypt, m_sign;
- QCheckBox m_armor, m_removeSource;
+ QCheckBox m_armor;
bool m_signingUserMutable, m_encryptionUserMutable, m_archiveUserMutable;
bool m_signingPreset, m_encryptionPreset;
const std::vector< shared_ptr<ArchiveDefinition> > m_archiveDefinitions;
@@ -818,18 +807,7 @@ public:
QStringLiteral("warn-encrypt-to-non-self"), KMessageBox::Notify | KMessageBox::Dangerous)
== KMessageBox::Cancel) {
return false;
- } else if (isRemoveUnencryptedFilesEnabled())
- if (KMessageBox::warningContinueCancel(this,
- xi18nc("@info",
- "<para>You have requested the unencrypted data to be removed after encryption.</para>"
- "<para>Are you really sure you do not need to access the data anymore in decrypted form?</para>"),
- i18nc("@title:window", "Encrypt-To-Self Warning"),
- KStandardGuiItem::cont(),
- KStandardGuiItem::cancel(),
- QStringLiteral("warn-encrypt-to-non-self-destructive"), KMessageBox::Notify | KMessageBox::Dangerous)
- == KMessageBox::Cancel) {
- return false;
- }
+ }
}
return true;
}
@@ -1224,11 +1202,6 @@ bool NewSignEncryptFilesWizard::isAsciiArmorEnabled() const
return field(QStringLiteral("armor")).toBool();
}
-bool NewSignEncryptFilesWizard::isRemoveUnencryptedFilesEnabled() const
-{
- return isEncryptionSelected() && field(QStringLiteral("remove")).toBool();
-}
-
bool NewSignEncryptFilesWizard::isCreateArchiveSelected() const
{
return field(QStringLiteral("archive")).toBool();
diff --git a/src/crypto/gui/newsignencryptfileswizard.h b/src/crypto/gui/newsignencryptfileswizard.h
index 10a42a1..33fa4f7 100644
--- a/src/crypto/gui/newsignencryptfileswizard.h
+++ b/src/crypto/gui/newsignencryptfileswizard.h
@@ -108,7 +108,6 @@ public:
bool isEncryptionSelected() const;
bool isAsciiArmorEnabled() const;
- bool isRemoveUnencryptedFilesEnabled() const;
const std::vector<GpgME::Key> &resolvedRecipients() const;
std::vector<GpgME::Key> resolvedSigners() const;
diff --git a/src/crypto/gui/signencryptwizard.cpp b/src/crypto/gui/signencryptwizard.cpp
index 2f02ad5..a54ae24 100644
--- a/src/crypto/gui/signencryptwizard.cpp
+++ b/src/crypto/gui/signencryptwizard.cpp
@@ -257,16 +257,6 @@ void SignEncryptWizard::setAsciiArmorEnabled(bool enabled)
d->signerResolvePage->setAsciiArmorEnabled(enabled);
}
-bool SignEncryptWizard::removeUnencryptedFile() const
-{
- return d->signerResolvePage->removeUnencryptedFile();
-}
-
-void SignEncryptWizard::setRemoveUnencryptedFile(bool remove)
-{
- d->signerResolvePage->setRemoveUnencryptedFile(remove);
-}
-
bool SignEncryptWizard::recipientsUserMutable() const
{
return d->recipientResolvePage->recipientsUserMutable();
diff --git a/src/crypto/gui/signerresolvepage.cpp b/src/crypto/gui/signerresolvepage.cpp
index cf23aed..6f2edcb 100644
--- a/src/crypto/gui/signerresolvepage.cpp
+++ b/src/crypto/gui/signerresolvepage.cpp
@@ -273,7 +273,6 @@ private:
QLabel *signerLabel;
QGroupBox *encryptBox;
QCheckBox *textArmorCO;
- QCheckBox *removeUnencryptedCO;
QPushButton *selectCertificatesButton;
SigningProtocolSelectionWidget *signingProtocolSelectionWidget;
ReadOnlyProtocolSelectionWidget *readOnlyProtocolSelectionWidget;
@@ -333,10 +332,6 @@ SignerResolvePage::Private::Private(SignerResolvePage *qq)
textArmorCO = new QCheckBox;
textArmorCO->setText(i18n("Text output (ASCII armor)"));
encryptLayout->addWidget(textArmorCO);
- removeUnencryptedCO = new QCheckBox;
- removeUnencryptedCO->setText(i18n("Remove unencrypted original file when done"));
- removeUnencryptedCO->setChecked(false);
- encryptLayout->addWidget(removeUnencryptedCO);
layout->addWidget(encryptBox);
signingCertificateBox = new QGroupBox;
@@ -674,16 +669,6 @@ void SignerResolvePage::setAsciiArmorEnabled(bool enabled)
d->textArmorCO->setChecked(enabled);
}
-bool SignerResolvePage::removeUnencryptedFile() const
-{
- return d->removeUnencryptedCO->isChecked();
-}
-
-void SignerResolvePage::setRemoveUnencryptedFile(bool remove)
-{
- d->removeUnencryptedCO->setChecked(remove);
-}
-
void SignerResolvePage::setSigningPreferences(const boost::shared_ptr<SigningPreferences> &prefs)
{
d->signingPreferences = prefs;
diff --git a/src/crypto/gui/signerresolvepage.h b/src/crypto/gui/signerresolvepage.h
index db7f00a..9362ab5 100644
--- a/src/crypto/gui/signerresolvepage.h
+++ b/src/crypto/gui/signerresolvepage.h
@@ -88,9 +88,6 @@ public:
bool isAsciiArmorEnabled() const;
void setAsciiArmorEnabled(bool enabled);
- bool removeUnencryptedFile() const;
- void setRemoveUnencryptedFile(bool remove);
-
void setPresetProtocol(GpgME::Protocol protocol);
void setPresetProtocols(const std::vector<GpgME::Protocol> &protocols);
diff --git a/src/crypto/signencryptfilescontroller.cpp b/src/crypto/signencryptfilescontroller.cpp
index 6854323..6091040 100644
--- a/src/crypto/signencryptfilescontroller.cpp
+++ b/src/crypto/signencryptfilescontroller.cpp
@@ -321,13 +321,12 @@ static const char *extension(bool pgp, bool sign, bool encrypt, bool ascii, bool
}
static shared_ptr<SignEncryptFilesTask>
-createSignEncryptTaskForFileInfo(const QFileInfo &fi, bool pgp, bool sign, bool encrypt, bool ascii, bool removeUnencrypted, const std::vector<Key> &recipients, const std::vector<Key> &signers)
+createSignEncryptTaskForFileInfo(const QFileInfo &fi, bool pgp, bool sign, bool encrypt, bool ascii, const std::vector<Key> &recipients, const std::vector<Key> &signers)
{
const shared_ptr<SignEncryptFilesTask> task(new SignEncryptFilesTask);
task->setSign(sign);
task->setEncrypt(encrypt);
task->setAsciiArmor(ascii);
- task->setRemoveInputFileOnSuccess(removeUnencrypted);
if (sign) {
task->setSigners(signers);
task->setDetachedSignature(true);
@@ -350,13 +349,12 @@ createSignEncryptTaskForFileInfo(const QFileInfo &fi, bool pgp, bool sign, bool
}
static shared_ptr<SignEncryptFilesTask>
-createArchiveSignEncryptTaskForFiles(const QStringList &files, const QString &outputFileBaseName, const shared_ptr<ArchiveDefinition> &ad, bool pgp, bool sign, bool encrypt, bool ascii, bool removeUnencrypted, const std::vector<Key> &recipients, const std::vector<Key> &signers)
+createArchiveSignEncryptTaskForFiles(const QStringList &files, const QString &outputFileBaseName, const shared_ptr<ArchiveDefinition> &ad, bool pgp, bool sign, bool encrypt, bool ascii, const std::vector<Key> &recipients, const std::vector<Key> &signers)
{
const shared_ptr<SignEncryptFilesTask> task(new SignEncryptFilesTask);
task->setSign(sign);
task->setEncrypt(encrypt);
task->setAsciiArmor(ascii);
- task->setRemoveInputFileOnSuccess(removeUnencrypted);
if (sign) {
task->setSigners(signers);
task->setDetachedSignature(false);
@@ -382,7 +380,7 @@ createArchiveSignEncryptTaskForFiles(const QStringList &files, const QString &ou
}
static std::vector< shared_ptr<SignEncryptFilesTask> >
-createSignEncryptTasksForFileInfo(const QFileInfo &fi, bool sign, bool encrypt, bool ascii, bool removeUnencrypted, const std::vector<Key> &pgpRecipients, const std::vector<Key> &pgpSigners, const std::vector<Key> &cmsRecipients, const std::vector<Key> &cmsSigners)
+createSignEncryptTasksForFileInfo(const QFileInfo &fi, bool sign, bool encrypt, bool ascii, const std::vector<Key> &pgpRecipients, const std::vector<Key> &pgpSigners, const std::vector<Key> &cmsRecipients, const std::vector<Key> &cmsSigners)
{
std::vector< shared_ptr<SignEncryptFilesTask> > result;
@@ -397,17 +395,17 @@ createSignEncryptTasksForFileInfo(const QFileInfo &fi, bool sign, bool encrypt,
result.reserve(pgp + cms);
if (pgp) {
- result.push_back(createSignEncryptTaskForFileInfo(fi, true, sign, encrypt, ascii, removeUnencrypted, pgpRecipients, pgpSigners));
+ result.push_back(createSignEncryptTaskForFileInfo(fi, true, sign, encrypt, ascii, pgpRecipients, pgpSigners));
}
if (cms) {
- result.push_back(createSignEncryptTaskForFileInfo(fi, false, sign, encrypt, ascii, removeUnencrypted, cmsRecipients, cmsSigners));
+ result.push_back(createSignEncryptTaskForFileInfo(fi, false, sign, encrypt, ascii, cmsRecipients, cmsSigners));
}
return result;
}
static std::vector< shared_ptr<SignEncryptFilesTask> >
-createArchiveSignEncryptTasksForFiles(const QStringList &files, const QString &pgpOutputFileBaseName, const QString &cmsOutputFileBaseName, const shared_ptr<ArchiveDefinition> &ad, bool sign, bool encrypt, bool ascii, bool removeUnencrypted, const std::vector<Key> &pgpRecipients, const std::vector<Key> &pgpSigners, const std::vector<Key> &cmsRecipients, const std::vector<Key> &cmsSigners)
+createArchiveSignEncryptTasksForFiles(const QStringList &files, const QString &pgpOutputFileBaseName, const QString &cmsOutputFileBaseName, const shared_ptr<ArchiveDefinition> &ad, bool sign, bool encrypt, bool ascii, const std::vector<Key> &pgpRecipients, const std::vector<Key> &pgpSigners, const std::vector<Key> &cmsRecipients, const std::vector<Key> &cmsSigners)
{
std::vector< shared_ptr<SignEncryptFilesTask> > result;
@@ -422,10 +420,10 @@ createArchiveSignEncryptTasksForFiles(const QStringList &files, const QString &p
result.reserve(pgp + cms);
if (pgp) {
- result.push_back(createArchiveSignEncryptTaskForFiles(files, pgpOutputFileBaseName, ad, true, sign, encrypt, ascii, removeUnencrypted, pgpRecipients, pgpSigners));
+ result.push_back(createArchiveSignEncryptTaskForFiles(files, pgpOutputFileBaseName, ad, true, sign, encrypt, ascii, pgpRecipients, pgpSigners));
}
if (cms) {
- result.push_back(createArchiveSignEncryptTaskForFiles(files, cmsOutputFileBaseName, ad, false, sign, encrypt, ascii, removeUnencrypted, cmsRecipients, cmsSigners));
+ result.push_back(createArchiveSignEncryptTaskForFiles(files, cmsOutputFileBaseName, ad, false, sign, encrypt, ascii, cmsRecipients, cmsSigners));
}
return result;
@@ -445,7 +443,6 @@ void SignEncryptFilesController::Private::slotWizardOperationPrepared()
const bool encrypt = wizard->isEncryptionSelected();
const bool ascii = wizard->isAsciiArmorEnabled();
- const bool removeUnencrypted = wizard->isRemoveUnencryptedFilesEnabled();
std::vector<Key> pgpRecipients, cmsRecipients, pgpSigners, cmsSigners;
if (encrypt) {
@@ -479,12 +476,12 @@ void SignEncryptFilesController::Private::slotWizardOperationPrepared()
wizard->archiveFileName(OpenPGP),
wizard->archiveFileName(CMS),
wizard->selectedArchiveDefinition(),
- sign, encrypt, ascii, removeUnencrypted,
+ sign, encrypt, ascii,
pgpRecipients, pgpSigners, cmsRecipients, cmsSigners);
else
Q_FOREACH (const QString &file, files) {
const std::vector< shared_ptr<SignEncryptFilesTask> > created =
- createSignEncryptTasksForFileInfo(QFileInfo(file), sign, encrypt, ascii, removeUnencrypted, pgpRecipients, pgpSigners, cmsRecipients, cmsSigners);
+ createSignEncryptTasksForFileInfo(QFileInfo(file), sign, encrypt, ascii, pgpRecipients, pgpSigners, cmsRecipients, cmsSigners);
tasks.insert(tasks.end(), created.begin(), created.end());
}
diff --git a/src/crypto/signencryptfilestask.cpp b/src/crypto/signencryptfilestask.cpp
index 91d29a7..d475a2b 100644
--- a/src/crypto/signencryptfilestask.cpp
+++ b/src/crypto/signencryptfilestask.cpp
@@ -69,10 +69,10 @@ using namespace GpgME;
namespace
{
-QString formatInputOutputLabel(const QString &input, const QString &output, bool inputDeleted, bool outputDeleted)
+QString formatInputOutputLabel(const QString &input, const QString &output, bool outputDeleted)
{
return i18nc("Input file --> Output file (rarr is arrow", "%1 &rarr; %2",
- inputDeleted ? QStringLiteral("<s>%1</s>").arg(input.toHtmlEscaped()) : input.toHtmlEscaped(),
+ input.toHtmlEscaped(),
outputDeleted ? QStringLiteral("<s>%1</s>").arg(output.toHtmlEscaped()) : output.toHtmlEscaped());
}
@@ -113,14 +113,13 @@ private:
class SignEncryptFilesResult : public Task::Result
{
public:
- SignEncryptFilesResult(const SigningResult &sr, const shared_ptr<Input> &input, const shared_ptr<Output> &output, bool inputRemoved, bool outputCreated, const AuditLog &auditLog)
+ SignEncryptFilesResult(const SigningResult &sr, const shared_ptr<Input> &input, const shared_ptr<Output> &output, bool outputCreated, const AuditLog &auditLog)
: Task::Result(),
m_sresult(sr),
m_inputLabel(input ? input->label() : QString()),
m_inputErrorString(input ? input->errorString() : QString()),
m_outputLabel(output ? output->label() : QString()),
m_outputErrorString(output ? output->errorString() : QString()),
- m_inputRemoved(inputRemoved),
m_outputCreated(outputCreated),
m_auditLog(auditLog)
{
@@ -129,14 +128,13 @@ public:
<< "outputError:" << m_outputErrorString;
assert(!m_sresult.isNull());
}
- SignEncryptFilesResult(const EncryptionResult &er, const shared_ptr<Input> &input, const shared_ptr<Output> &output, bool inputRemoved, bool outputCreated, const AuditLog &auditLog)
+ SignEncryptFilesResult(const EncryptionResult &er, const shared_ptr<Input> &input, const shared_ptr<Output> &output, bool outputCreated, const AuditLog &auditLog)
: Task::Result(),
m_eresult(er),
m_inputLabel(input ? input->label() : QString()),
m_inputErrorString(input ? input->errorString() : QString()),
m_outputLabel(output ? output->label() : QString()),
m_outputErrorString(output ? output->errorString() : QString()),
- m_inputRemoved(inputRemoved),
m_outputCreated(outputCreated),
m_auditLog(auditLog)
{
@@ -145,7 +143,7 @@ public:
<< "outputError:" << m_outputErrorString;
assert(!m_eresult.isNull());
}
- SignEncryptFilesResult(const SigningResult &sr, const EncryptionResult &er, const shared_ptr<Input> &input, const shared_ptr<Output> &output, bool inputRemoved, bool outputCreated, const AuditLog &auditLog)
+ SignEncryptFilesResult(const SigningResult &sr, const EncryptionResult &er, const shared_ptr<Input> &input, const shared_ptr<Output> &output, bool outputCreated, const AuditLog &auditLog)
: Task::Result(),
m_sresult(sr),
m_eresult(er),
@@ -153,7 +151,6 @@ public:
m_inputErrorString(input ? input->errorString() : QString()),
m_outputLabel(output ? output->label() : QString()),
m_outputErrorString(output ? output->errorString() : QString()),
- m_inputRemoved(inputRemoved),
m_outputCreated(outputCreated),
m_auditLog(auditLog)
{
@@ -177,7 +174,6 @@ private:
const QString m_inputErrorString;
const QString m_outputLabel;
const QString m_outputErrorString;
- const bool m_inputRemoved;
const bool m_outputCreated;
const AuditLog m_auditLog;
};
@@ -284,7 +280,7 @@ QString ErrorResult::overview() const
{
assert(m_error || m_error.isCanceled());
assert(m_sign || m_encrypt);
- const QString label = formatInputOutputLabel(m_inputLabel, m_outputLabel, false, true);
+ const QString label = formatInputOutputLabel(m_inputLabel, m_outputLabel, true);
const bool canceled = m_error.isCanceled();
if (m_sign && m_encrypt) {
return canceled ? i18n("%1: <b>Sign/encrypt canceled.</b>", label) : i18n(" %1: Sign/encrypt failed.", label);
@@ -327,7 +323,6 @@ private:
bool sign : 1;
bool encrypt : 1;
bool detached : 1;
- bool removeInput : 1;
QPointer<Kleo::Job> job;
shared_ptr<OverwritePolicy> m_overwritePolicy;
@@ -344,7 +339,6 @@ SignEncryptFilesTask::Private::Private(SignEncryptFilesTask *qq)
sign(true),
encrypt(true),
detached(false),
- removeInput(false),
job(0),
m_overwritePolicy(new OverwritePolicy(0))
{
@@ -422,12 +416,6 @@ void SignEncryptFilesTask::setEncrypt(bool encrypt)
d->encrypt = encrypt;
}
-void SignEncryptFilesTask::setRemoveInputFileOnSuccess(bool remove)
-{
- kleo_assert(!d->job);
- d->removeInput = remove;
-}
-
void SignEncryptFilesTask::setDetachedSignature(bool detached)
{
kleo_assert(!d->job);
@@ -556,7 +544,6 @@ void SignEncryptFilesTask::Private::slotResult(const SigningResult &result)
{
const Job *const job = qobject_cast<const Job *>(q->sender());
const AuditLog auditLog = AuditLog::fromJob(job);
- bool inputRemoved = false;
bool outputCreated = false;
if (result.error().code()) {
output->cancel();
@@ -566,25 +553,19 @@ void SignEncryptFilesTask::Private::slotResult(const SigningResult &result)
output->finalize();
outputCreated = true;
input->finalize();
- if (removeInput)
- try {
- kdtools::for_each(inputFileNames, recursivelyRemovePath);
- inputRemoved = true;
- } catch (...) {}
} catch (const GpgME::Exception &e) {
q->emitResult(makeErrorResult(e.error(), QString::fromLocal8Bit(e.what()), auditLog));
return;
}
}
- q->emitResult(shared_ptr<Result>(new SignEncryptFilesResult(result, input, output, inputRemoved, outputCreated, auditLog)));
+ q->emitResult(shared_ptr<Result>(new SignEncryptFilesResult(result, input, output, outputCreated, auditLog)));
}
void SignEncryptFilesTask::Private::slotResult(const SigningResult &sresult, const EncryptionResult &eresult)
{
const Job *const job = qobject_cast<const Job *>(q->sender());
const AuditLog auditLog = AuditLog::fromJob(job);
- bool inputRemoved = false;
bool outputCreated = false;
if (sresult.error().code() || eresult.error().code()) {
output->cancel();
@@ -594,25 +575,19 @@ void SignEncryptFilesTask::Private::slotResult(const SigningResult &sresult, con
output->finalize();
outputCreated = true;
input->finalize();
- if (removeInput)
- try {
- kdtools::for_each(inputFileNames, recursivelyRemovePath);
- inputRemoved = true;
- } catch (...) {}
} catch (const GpgME::Exception &e) {
q->emitResult(makeErrorResult(e.error(), QString::fromLocal8Bit(e.what()), auditLog));
return;
}
}
- q->emitResult(shared_ptr<Result>(new SignEncryptFilesResult(sresult, eresult, input, output, inputRemoved, outputCreated, auditLog)));
+ q->emitResult(shared_ptr<Result>(new SignEncryptFilesResult(sresult, eresult, input, output, outputCreated, auditLog)));
}
void SignEncryptFilesTask::Private::slotResult(const EncryptionResult &result)
{
const Job *const job = qobject_cast<const Job *>(q->sender());
const AuditLog auditLog = AuditLog::fromJob(job);
- bool inputRemoved = false;
bool outputCreated = false;
if (result.error().code()) {
output->cancel();
@@ -622,22 +597,17 @@ void SignEncryptFilesTask::Private::slotResult(const EncryptionResult &result)
output->finalize();
outputCreated = true;
input->finalize();
- if (removeInput)
- try {
- kdtools::for_each(inputFileNames, recursivelyRemovePath);
- inputRemoved = true;
- } catch (...) {}
} catch (const GpgME::Exception &e) {
q->emitResult(makeErrorResult(e.error(), QString::fromLocal8Bit(e.what()), auditLog));
return;
}
}
- q->emitResult(shared_ptr<Result>(new SignEncryptFilesResult(result, input, output, inputRemoved, outputCreated, auditLog)));
+ q->emitResult(shared_ptr<Result>(new SignEncryptFilesResult(result, input, output, outputCreated, auditLog)));
}
QString SignEncryptFilesResult::overview() const
{
- const QString files = formatInputOutputLabel(m_inputLabel, m_outputLabel, m_inputRemoved, !m_outputCreated);
+ const QString files = formatInputOutputLabel(m_inputLabel, m_outputLabel, !m_outputCreated);
return files + QLatin1String(": ") + makeOverview(makeResultOverview(m_sresult, m_eresult));
}
diff --git a/src/crypto/signencryptfilestask.h b/src/crypto/signencryptfilestask.h
index d33dfb6..5daf7a3 100644
--- a/src/crypto/signencryptfilestask.h
+++ b/src/crypto/signencryptfilestask.h
@@ -80,7 +80,6 @@ public:
void setSign(bool sign);
void setEncrypt(bool encrypt);
- void setRemoveInputFileOnSuccess(bool);
void setDetachedSignature(bool detached);
void setOverwritePolicy(const boost::shared_ptr<OverwritePolicy> &policy);