From 84fb5cfe96263f79e50b68a5a6996e40c514cf74 Mon Sep 17 00:00:00 2001 From: rbuj Date: Mon, 5 Oct 2020 15:58:40 +0200 Subject: Add Electronic Publication (EPUB) support $ file -b --mime-type don-quijoti-epub3.epub application/epub+zip --- README | 1 + caja/caja-engrampa.c | 1 + data/engrampa.desktop.in.in | 2 +- help/C/index.docbook | 4 ++++ src/fr-command-7z.c | 6 ++++-- src/fr-command-zip.c | 1 + src/fr-init.c | 2 ++ 7 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README b/README index 2249762..55b5e1a 100644 --- a/README +++ b/README @@ -24,6 +24,7 @@ * Cabinet File (.cab) * UNIX CPIO Archive (.cpio) * Debian Linux Package (.deb) [Read-only mode] + * EPUB (.epub) * ISO-9660 CD Disc Image (.iso) [Read-only mode] * Java Archive (.jar) * Java Enterprise archive (.ear) diff --git a/caja/caja-engrampa.c b/caja/caja-engrampa.c index ab32d59..57b440a 100644 --- a/caja/caja-engrampa.c +++ b/caja/caja-engrampa.c @@ -145,6 +145,7 @@ static struct { } archive_mime_types[] = { { "application/vnd.debian.binary-package", TRUE }, { "application/vnd.ms-cab-compressed", TRUE }, + { "application/epub+zip", TRUE }, { "application/x-7z-compressed", TRUE }, { "application/x-7z-compressed-tar", TRUE }, { "application/x-ace", TRUE }, diff --git a/data/engrampa.desktop.in.in b/data/engrampa.desktop.in.in index a118adf..c23c8ab 100644 --- a/data/engrampa.desktop.in.in +++ b/data/engrampa.desktop.in.in @@ -11,7 +11,7 @@ Type=Application Icon=engrampa # Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon! Categories=GTK;Utility;Archiving;Compression; -MimeType=application/x-7z-compressed;application/x-7z-compressed-tar;application/x-ace;application/x-alz;application/x-arc;application/x-arj;application/x-brotli;application/x-brotli-compressed-tar;application/x-bzip;application/x-bzip-compressed-tar;application/x-bzip1;application/x-bzip1-compressed-tar;application/x-cabinet;application/x-cbr;application/x-cbz;application/x-cd-image;application/x-compress;application/x-compressed-tar;application/x-cpio;application/vnd.debian.binary-package;application/x-ear;application/x-ms-dos-executable;application/x-gtar;application/x-gzip;application/x-gzpostscript;application/x-java-archive;application/x-lha;application/x-lzh-compressed;application/x-lrzip;application/x-lrzip-compressed-tar;application/x-lzip;application/x-lzip-compressed-tar;application/x-lzma;application/x-lzma-compressed-tar;application/x-lzop;application/x-lzop-compressed-tar;application/x-ms-wim;application/x-rar;application/x-rar-compressed;application/x-rpm;application/x-source-rpm;application/x-rzip;application/x-tar;application/x-tarz;application/x-stuffit;application/x-war;application/x-xz;application/x-xz-compressed-tar;application/x-zip;application/x-zip-compressed;application/x-zoo;@ZSTD_MIME_TYPE@;application/x-zstd-compressed-tar;application/zip;application/x-archive;application/vnd.ms-cab-compressed; +MimeType=application/epub+zip;application/x-7z-compressed;application/x-7z-compressed-tar;application/x-ace;application/x-alz;application/x-arc;application/x-arj;application/x-brotli;application/x-brotli-compressed-tar;application/x-bzip;application/x-bzip-compressed-tar;application/x-bzip1;application/x-bzip1-compressed-tar;application/x-cabinet;application/x-cbr;application/x-cbz;application/x-cd-image;application/x-compress;application/x-compressed-tar;application/x-cpio;application/vnd.debian.binary-package;application/x-ear;application/x-ms-dos-executable;application/x-gtar;application/x-gzip;application/x-gzpostscript;application/x-java-archive;application/x-lha;application/x-lzh-compressed;application/x-lrzip;application/x-lrzip-compressed-tar;application/x-lzip;application/x-lzip-compressed-tar;application/x-lzma;application/x-lzma-compressed-tar;application/x-lzop;application/x-lzop-compressed-tar;application/x-ms-wim;application/x-rar;application/x-rar-compressed;application/x-rpm;application/x-source-rpm;application/x-rzip;application/x-tar;application/x-tarz;application/x-stuffit;application/x-war;application/x-xz;application/x-xz-compressed-tar;application/x-zip;application/x-zip-compressed;application/x-zoo;@ZSTD_MIME_TYPE@;application/x-zstd-compressed-tar;application/zip;application/x-archive;application/vnd.ms-cab-compressed; # Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon! Keywords=MATE;archive;manager;compression; X-MATE-DocPath=engrampa/engrampa.xml diff --git a/help/C/index.docbook b/help/C/index.docbook index 0dc66bf..023fcdc 100644 --- a/help/C/index.docbook +++ b/help/C/index.docbook @@ -291,6 +291,10 @@ Debian package .deb, .udeb + + Electronic Publication + .epub + RAW CD image (ISO 9660) .iso diff --git a/src/fr-command-7z.c b/src/fr-command-7z.c index bd8406b..796e03a 100644 --- a/src/fr-command-7z.c +++ b/src/fr-command-7z.c @@ -578,7 +578,8 @@ fr_command_7z_handle_error (FrCommand *comm, } -const char *sevenz_mime_types[] = { "application/x-7z-compressed", +const char *sevenz_mime_types[] = { "application/epub+zip", + "application/x-7z-compressed", "application/x-arj", "application/vnd.ms-cab-compressed", "application/x-cd-image", @@ -641,7 +642,8 @@ fr_command_7z_get_capabilities (FrCommand *comm, else capabilities |= FR_COMMAND_CAN_READ; - if (is_mime_type (mime_type, "application/x-cbz") + if (is_mime_type (mime_type, "application/epub+zip") + || is_mime_type (mime_type, "application/x-cbz") || is_mime_type (mime_type, "application/x-ms-dos-executable") || is_mime_type (mime_type, "application/zip")) { diff --git a/src/fr-command-zip.c b/src/fr-command-zip.c index f16cc9a..9469e91 100644 --- a/src/fr-command-zip.c +++ b/src/fr-command-zip.c @@ -382,6 +382,7 @@ fr_command_zip_handle_error (FrCommand *comm, const char *zip_mime_type[] = { + "application/epub+zip", "application/vnd.oasis.opendocument.presentation", "application/vnd.oasis.opendocument.spreadsheet", "application/vnd.oasis.opendocument.text", diff --git a/src/fr-init.c b/src/fr-init.c index 850df07..7d7b313 100644 --- a/src/fr-init.c +++ b/src/fr-init.c @@ -66,6 +66,7 @@ FrMimeTypeDescription mime_type_desc[] = { { "application/vnd.oasis.opendocument.presentation-template", ".otp", N_("OpenDocument Presentation Template"), 0 }, { "application/vnd.oasis.opendocument.spreadsheet-template", ".ots", N_("OpenDocument Spreadsheet Template"), 0 }, { "application/vnd.oasis.opendocument.text-template", ".ott", N_("OpenDocument Text Template"), 0 }, + { "application/epub+zip", ".epub", N_("Electronic Publication"), 0 }, { "application/x-7z-compressed", ".7z", N_("7-Zip"), 0 }, { "application/x-7z-compressed-tar", ".tar.7z", N_("Tar compressed with 7z"), 0 }, { "application/x-ace", ".ace", N_("Ace"), 0 }, @@ -133,6 +134,7 @@ FrExtensionType file_ext_type[] = { { ".cpio", "application/x-cpio" }, { ".deb", "application/vnd.debian.binary-package" }, { ".ear", "application/x-ear" }, + { ".epub", "application/epub+zip" }, { ".exe", "application/x-ms-dos-executable" }, { ".gz", "application/x-gzip" }, { ".iso", "application/x-cd-image" }, -- cgit v1.2.1