Commit 7be4f02b authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Add option to control automatic extraction of decrypted archives

By default, file archives are automatically extracted after decryption.
This option allows the users to disable the automatic extraction.

GnuPG-bug-id: 6057
parent bd14c41d
......@@ -383,13 +383,17 @@ std::vector< std::shared_ptr<Task> > AutoDecryptVerifyFilesController::Private::
qCDebug(KLEOPATRA_LOG) << "Failed detection for: " << cFile.fileName << " adding to undetected.";
}
} else {
const FileOperationsPreferences fileOpSettings;
// Any Message type so we have input and output.
const auto input = Input::createFromFile(cFile.fileName);
const auto archiveDefinitions = ArchiveDefinition::getArchiveDefinitions();
const auto ad = q->pick_archive_definition(cFile.protocol, archiveDefinitions, cFile.fileName);
std::shared_ptr<ArchiveDefinition> ad;
if (fileOpSettings.autoExtractArchives()) {
const auto archiveDefinitions = ArchiveDefinition::getArchiveDefinitions();
ad = q->pick_archive_definition(cFile.protocol, archiveDefinitions, cFile.fileName);
}
if (FileOperationsPreferences().dontUseTmpDir()) {
if (fileOpSettings.dontUseTmpDir()) {
if (!m_workDir) {
m_workDir = new QTemporaryDir(heuristicBaseDirectory(fileNames) + QStringLiteral("/kleopatra-XXXXXX"));
}
......@@ -405,9 +409,8 @@ std::vector< std::shared_ptr<Task> > AutoDecryptVerifyFilesController::Private::
const auto wd = QDir(m_workDir->path());
const auto output =
ad ? ad->createOutputFromUnpackCommand(cFile.protocol, cFile.fileName, wd) :
/*else*/ Output::createFromFile(wd.absoluteFilePath(outputFileName(fi.fileName())), false);
const auto output = ad ? ad->createOutputFromUnpackCommand(cFile.protocol, cFile.fileName, wd)
: Output::createFromFile(wd.absoluteFilePath(outputFileName(fi.fileName())), false);
// If this might be opaque CMS signature, then try that. We already handled
// detached CMS signature above
......
......@@ -16,6 +16,11 @@
<whatsthis>With this option set Kleopatra no longer asks you what you want to do with input files but instead automatically starts the operations it detects as applicable to the input.</whatsthis>
<default>true</default>
</entry>
<entry name="AutoExtractArchives" key="auto-extract-archives" type="Bool">
<label>Automatically extract archives after decryption.</label>
<whatsthis>If this option is set, then Kleopatra automatically extracts file archives after decryption.</whatsthis>
<default>true</default>
</entry>
<entry name="ArchiveCommand" key="default-archive-cmd" type="String">
<label>Use this command to create file archives.</label>
<whatsthis>When encrypting multiple files or a folder Kleopatra creates an encrypted archive with this command.</whatsthis>
......
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