Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/backend
diff options
context:
space:
mode:
authorJuanjo MarĂ­n <juanj.marin@juntadeandalucia.es>2009-12-11 13:40:43 (GMT)
committer Carlos Garcia Campos <carlosgc@gnome.org>2009-12-11 13:40:43 (GMT)
commitd68a91467efab8ef8a8f98589dd4c21b993b6e14 (patch)
tree903b7629bd129ad1888f6658f06e0b1b59eccd46 /backend
parenta90c2239d39181519c53f0b02b5af90be0d7ef3d (diff)
[comics] Add support for cbt files
Fixes bgo#588266.
Diffstat (limited to 'backend')
-rw-r--r--backend/comics/comics-document.c26
-rw-r--r--backend/comics/comicsdocument.evince-backend.in2
2 files changed, 20 insertions, 8 deletions
diff --git a/backend/comics/comics-document.c b/backend/comics/comics-document.c
index c871860..2e867b5 100644
--- a/backend/comics/comics-document.c
+++ b/backend/comics/comics-document.c
@@ -40,7 +40,8 @@ typedef enum
RARLABS,
GNAUNRAR,
UNZIP,
- P7ZIP
+ P7ZIP,
+ TAR
} ComicBookDecompressType;
typedef struct _ComicsDocumentClass ComicsDocumentClass;
@@ -91,16 +92,19 @@ typedef struct {
static const ComicBookDecompressCommand command_usage_def[] = {
/* RARLABS unrar */
- {"%s p -c- -ierr", "%s vb -c- -- %s", NULL , FALSE, NO_OFFSET},
+ {"%s p -c- -ierr --", "%s vb -c- -- %s", NULL , FALSE, NO_OFFSET},
/* GNA! unrar */
- {NULL , "%s t %s" , "%s -xf %s %s" , TRUE , NO_OFFSET},
+ {NULL , "%s t %s" , "%s -xf %s %s" , TRUE , NO_OFFSET},
/* unzip */
- {"%s -p -C" , "%s -Z -1 -- %s" , NULL , TRUE , NO_OFFSET},
+ {"%s -p -C --" , "%s -Z -1 -- %s" , NULL , TRUE , NO_OFFSET},
/* 7zip */
- {NULL , "%s l -- %s" , "%s x -y %s -o%s", FALSE, OFFSET_7Z}
+ {NULL , "%s l -- %s" , "%s x -y %s -o%s", FALSE, OFFSET_7Z},
+
+ /* tar */
+ {"%s -xOf" , "%s -tf %s" , NULL , FALSE, NO_OFFSET}
};
static void comics_document_document_thumbnails_iface_init (EvDocumentThumbnailsIface *iface);
@@ -350,6 +354,15 @@ comics_check_decompress_command (gchar *mime_type,
comics_document->command_usage = P7ZIP;
return TRUE;
}
+ } else if (!strcmp (mime_type, "application/x-cbt") ||
+ !strcmp (mime_type, "application/x-tar")) {
+ /* tar utility (Tape ARchive) */
+ comics_document->selected_command =
+ g_find_program_in_path ("tar");
+ if (comics_document->selected_command) {
+ comics_document->command_usage = TAR;
+ return TRUE;
+ }
} else {
g_set_error (error,
EV_DOCUMENT_ERROR,
@@ -850,11 +863,10 @@ extract_argv (EvDocument *document, gint page)
quoted_filename = g_shell_quote (comics_document->page_names->pdata[page]);
}
- command_line = g_strdup_printf ("%s -- %s %s",
+ command_line = g_strdup_printf ("%s %s %s",
comics_document->extract_command,
quoted_archive,
quoted_filename);
-
g_shell_parse_argv (command_line, NULL, &argv, &err);
if (err) {
diff --git a/backend/comics/comicsdocument.evince-backend.in b/backend/comics/comicsdocument.evince-backend.in
index d46161d..90d4c01 100644
--- a/backend/comics/comicsdocument.evince-backend.in
+++ b/backend/comics/comicsdocument.evince-backend.in
@@ -1,4 +1,4 @@
[Evince Backend]
Module=comicsdocument
_TypeDescription=Comic Books
-MimeType=application/x-cbr;application/x-cbz;application/x-cb7;
+MimeType=application/x-cbr;application/x-cbz;application/x-cb7;application/x-cbt;