Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Ark
Commits
b564e0ac
Commit
b564e0ac
authored
Jun 27, 2021
by
Alexey Ivanov
🐢
Committed by
Elvis Angelaccio
Jul 04, 2021
Browse files
libzipplugin: hack for zstd max compression method.
parent
18698b25
Changes
2
Hide whitespace changes
Inline
Side-by-side
kerfuffle/compressionoptionswidget.cpp
View file @
b564e0ac
...
...
@@ -27,7 +27,6 @@
#include "compressionoptionswidget.h"
#include "ark_debug.h"
#include "archiveformat.h"
#include "pluginmanager.h"
#include "settings.h"
...
...
@@ -110,10 +109,15 @@ QString CompressionOptionsWidget::password() const
return
pwdWidget
->
password
();
}
void
CompressionOptionsWidget
::
updateWidgets
()
ArchiveFormat
CompressionOptionsWidget
::
getArchiveFormat
()
const
{
const
KPluginMetaData
metadata
=
PluginManager
().
preferredPluginFor
(
m_mimetype
)
->
metaData
();
const
ArchiveFormat
archiveFormat
=
ArchiveFormat
::
fromMetadata
(
m_mimetype
,
metadata
);
return
ArchiveFormat
::
fromMetadata
(
m_mimetype
,
metadata
);
}
void
CompressionOptionsWidget
::
updateWidgets
()
{
const
ArchiveFormat
archiveFormat
=
getArchiveFormat
();
Q_ASSERT
(
archiveFormat
.
isValid
());
if
(
archiveFormat
.
encryptionType
()
!=
Archive
::
Unencrypted
)
{
...
...
@@ -283,7 +287,19 @@ void CompressionOptionsWidget::slotCompMethodChanged(const QString &value)
}
else
{
encMethodComboBox
->
insertItem
(
0
,
QStringLiteral
(
"AES256"
));
}
}
const
ArchiveFormat
archiveFormat
=
getArchiveFormat
();
Q_ASSERT
(
archiveFormat
.
isValid
());
if
(
m_mimetype
==
QMimeDatabase
().
mimeTypeForName
(
QStringLiteral
(
"application/zip"
)))
{
if
(
value
==
QLatin1String
(
"Zstd"
))
{
compLevelSlider
->
setMaximum
(
22
);
}
else
{
compLevelSlider
->
setMaximum
(
archiveFormat
.
maxCompressionLevel
());
}
}
}
...
...
kerfuffle/compressionoptionswidget.h
View file @
b564e0ac
...
...
@@ -30,6 +30,7 @@
#include "kerfuffle_export.h"
#include "archive_kerfuffle.h"
#include "archiveformat.h"
#include "ui_compressionoptionswidget.h"
#include <QMimeType>
...
...
@@ -61,6 +62,7 @@ public:
private:
void
updateWidgets
();
ArchiveFormat
getArchiveFormat
()
const
;
QMimeType
m_mimetype
;
CompressionOptions
m_opts
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment