diff options
author | monsta <[email protected]> | 2016-10-21 14:50:23 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-10-21 14:50:23 +0300 |
commit | 4f653fb4bae6c7b5d163f85b4431ba5eea09cef5 (patch) | |
tree | 12ed449f6d206838ea43246550d3f06cc0a96750 /backend/comics | |
parent | 3bf78de084767290fe1ec402b8ff7b5558bf74f4 (diff) | |
download | atril-4f653fb4bae6c7b5d163f85b4431ba5eea09cef5.tar.bz2 atril-4f653fb4bae6c7b5d163f85b4431ba5eea09cef5.tar.xz |
comics: fix MIME type comparisons
taken from:
https://git.gnome.org/browse/evince/commit/?id=364b340
Diffstat (limited to 'backend/comics')
-rw-r--r-- | backend/comics/comics-document.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/backend/comics/comics-document.c b/backend/comics/comics-document.c index feeeec47..841524e7 100644 --- a/backend/comics/comics-document.c +++ b/backend/comics/comics-document.c @@ -306,8 +306,8 @@ comics_check_decompress_command (gchar *mime_type, /* FIXME, use proper cbr/cbz mime types once they're * included in shared-mime-info */ - if (!strcmp (mime_type, "application/x-cbr") || - !strcmp (mime_type, "application/x-rar")) { + if (g_content_type_is_a (mime_type, "application/x-cbr") || + g_content_type_is_a (mime_type, "application/x-rar")) { /* The RARLAB provides a no-charge proprietary (freeware) * decompress-only client for Linux called unrar. Another * option is a GPLv2-licensed command-line tool developed by @@ -362,8 +362,8 @@ comics_check_decompress_command (gchar *mime_type, return TRUE; } - } else if (!strcmp (mime_type, "application/x-cbz") || - !strcmp (mime_type, "application/zip")) { + } else if (g_content_type_is_a (mime_type, "application/x-cbz") || + g_content_type_is_a (mime_type, "application/zip")) { /* InfoZIP's unzip program */ comics_document->selected_command = g_find_program_in_path ("unzip"); @@ -381,8 +381,8 @@ comics_check_decompress_command (gchar *mime_type, return TRUE; } - } else if (!strcmp (mime_type, "application/x-cb7") || - !strcmp (mime_type, "application/x-7z-compressed")) { + } else if (g_content_type_is_a (mime_type, "application/x-cb7") || + g_content_type_is_a (mime_type, "application/x-7z-compressed")) { /* 7zr, 7za and 7z are the commands from the p7zip project able * to decompress .7z files */ comics_document->selected_command = @@ -409,8 +409,8 @@ comics_check_decompress_command (gchar *mime_type, comics_document->command_usage = TAR; return TRUE; } - } else if (!strcmp (mime_type, "application/x-cbt") || - !strcmp (mime_type, "application/x-tar")) { + } else if (g_content_type_is_a (mime_type, "application/x-cbt") || + g_content_type_is_a (mime_type, "application/x-tar")) { /* tar utility (Tape ARchive) */ comics_document->selected_command = g_find_program_in_path ("tar"); |