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
12118a26
Commit
12118a26
authored
Jun 24, 2021
by
Alexey Ivanov
🐢
Committed by
Elvis Angelaccio
Jul 04, 2021
Browse files
libzipplugin: support lzma xz for libzip 1.8.0+
parent
b4e7ad8b
Changes
3
Hide whitespace changes
Inline
Side-by-side
plugins/libzipplugin/CMakeLists.txt
View file @
12118a26
include
(
CheckSymbolExists
)
set
(
SUPPORTED_LIBZIP_MIMETYPES
"application/zip;"
)
set
(
INSTALLED_LIBZIP_PLUGINS
""
)
...
...
@@ -15,10 +13,10 @@ ecm_qt_declare_logging_category(kerfuffle_libzip_SRCS
# double-quotes of the last mime must NOT be escaped.
set
(
SUPPORTED_MIMETYPES
"application/zip"
)
# TODO: replace with version-based check once there is a new libzip release with zstd support
check_symbol_exists
(
ZIP_CM_ZSTD
"zip.h"
HAVE_ZIP_CM_ZSTD
)
if
(
HAVE_ZIP_CM_ZSTD
)
if
(
LibZip_VERSION VERSION_GREATER_EQUAL
"1.8.0"
)
set
(
ZIP_CM_ZSTD_JSON_LINE
"
\"
Zstd
\"
:
\"
Zstd
\"
,"
)
set
(
ZIP_CM_LZMA_JSON_LINE
"
\"
LZMA
\"
:
\"
LZMA
\"
,"
)
set
(
ZIP_CM_XZ_JSON_LINE
"
\"
XZ
\"
:
\"
XZ
\"
,"
)
endif
()
find_package
(
ZLIB REQUIRED
)
...
...
plugins/libzipplugin/kerfuffle_libzip.json.cmake
View file @
12118a26
...
...
@@ -90,6 +90,8 @@
"CompressionMethods"
: {
"BZip2"
:
"BZip2"
,
@ZIP_CM_ZSTD_JSON_LINE@
@ZIP_CM_LZMA_JSON_LINE@
@ZIP_CM_XZ_JSON_LINE@
"Default"
:
"Default"
,
"Deflate"
:
"Deflate"
,
"Store"
:
"Store"
...
...
plugins/libzipplugin/libzipplugin.cpp
View file @
12118a26
...
...
@@ -267,6 +267,14 @@ bool LibzipPlugin::writeEntry(zip_t *archive, const QString &file, const Archive
#ifdef ZIP_CM_ZSTD
}
else
if
(
options
.
compressionMethod
()
==
QLatin1String
(
"Zstd"
))
{
compMethod
=
ZIP_CM_ZSTD
;
#endif
#ifdef ZIP_CM_LZMA
}
else
if
(
options
.
compressionMethod
()
==
QLatin1String
(
"LZMA"
))
{
compMethod
=
ZIP_CM_LZMA
;
#endif
#ifdef ZIP_CM_XZ
}
else
if
(
options
.
compressionMethod
()
==
QLatin1String
(
"XZ"
))
{
compMethod
=
ZIP_CM_XZ
;
#endif
}
else
if
(
options
.
compressionMethod
()
==
QLatin1String
(
"Store"
))
{
compMethod
=
ZIP_CM_STORE
;
...
...
@@ -335,12 +343,10 @@ bool LibzipPlugin::emitEntryForIndex(zip_t *archive, qlonglong index)
e
->
setProperty
(
"method"
,
QStringLiteral
(
"BZip2"
));
Q_EMIT
compressionMethodFound
(
QStringLiteral
(
"BZip2"
));
break
;
#ifdef ZIP_CM_ZSTD
case
ZIP_CM_ZSTD
:
e
->
setProperty
(
"method"
,
QStringLiteral
(
"Zstd"
));
Q_EMIT
compressionMethodFound
(
QStringLiteral
(
"Zstd"
));
break
;
#endif
break
;
case
ZIP_CM_LZMA
:
e
->
setProperty
(
"method"
,
QStringLiteral
(
"LZMA"
));
Q_EMIT
compressionMethodFound
(
QStringLiteral
(
"LZMA"
));
...
...
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