Commit 045a847d authored by Ragnar Thomsen's avatar Ragnar Thomsen
Browse files

Set compression level in libarchiveplugin

Summary: This sets compression level in libarchiveplugin if CompressionLevel is passed in CompressionOptions.

Reviewers: elvisangelaccio

Reviewed By: elvisangelaccio

Subscribers: kde-utils-devel

Projects: #ark

Differential Revision:
parent df39ac39
......@@ -184,6 +184,18 @@ bool ReadWriteLibarchivePlugin::addFiles(const QStringList& files, const Compres
return false;
// Set compression level if passed in CompressionOptions.
if (options.contains(QStringLiteral("CompressionLevel"))) {
qCDebug(ARK) << "Using compression level:" << options.value(QStringLiteral("CompressionLevel")).toString();
ret = archive_write_set_filter_option(, NULL, "compression-level", options.value(QStringLiteral("CompressionLevel")).toString().toUtf8());
if (ret != ARCHIVE_OK) {
qCWarning(ARK) << "Failed to set compression level";
emit error(xi18nc("@info", "Setting the compression level failed with the following error:<nl/><message>%1</message>",
return false;
ret = archive_write_open_fd(, tempFile.handle());
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