X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=libdocument%2Fev-file-helpers.c;h=cab0ad542c250e1b872bb3b4f875655e83d8a15b;hb=c70f6b907a881c731725a54eb72b516213dea6c7;hp=edd4e4fd0adc2414e6918cab61dc7bceb4ce75e8;hpb=b4b43ea75d5b9f70b11a5f128f12e32e0c61bcb9;p=evince.git diff --git a/libdocument/ev-file-helpers.c b/libdocument/ev-file-helpers.c index edd4e4fd..cab0ad54 100644 --- a/libdocument/ev-file-helpers.c +++ b/libdocument/ev-file-helpers.c @@ -525,8 +525,14 @@ ev_file_get_mime_type (const gchar *uri, } /* Compressed files support */ -#define BZIPCOMMAND "bzip2" -#define GZIPCOMMAND "gzip" + +static const char *compressor_cmds[] = { + NULL, + "bzip2", + "gzip", + "xz" +}; + #define N_ARGS 4 #define BUFFER_SIZE 1024 @@ -546,13 +552,13 @@ compression_run (const gchar *uri, if (type == EV_COMPRESSION_NONE) return NULL; - cmd = g_find_program_in_path ((type == EV_COMPRESSION_BZIP2) ? BZIPCOMMAND : GZIPCOMMAND); + cmd = g_find_program_in_path (compressor_cmds[type]); if (!cmd) { /* FIXME: better error codes! */ /* FIXME: i18n later */ g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, "Failed to find the \"%s\" command in the search path.", - type == EV_COMPRESSION_BZIP2 ? BZIPCOMMAND : GZIPCOMMAND); + compressor_cmds[type]); return NULL; }