diff options
author | Pablo Barciela <[email protected]> | 2018-08-03 02:41:00 +0200 |
---|---|---|
committer | ZenWalker <[email protected]> | 2018-08-22 03:26:46 +0200 |
commit | c587ae127cf0d6fee6b7e8c21bbe1c903faac13c (patch) | |
tree | 98df210a6dd79b4a4b6c9760663946c8c2a10939 /src/fr-command-zip.c | |
parent | 10e665ff9b410553582f3764674fabe8d6a3e246 (diff) | |
download | engrampa-c587ae127cf0d6fee6b7e8c21bbe1c903faac13c.tar.bz2 engrampa-c587ae127cf0d6fee6b7e8c21bbe1c903faac13c.tar.xz |
Add the ability to support 'unar' over .zip archives
Closes https://github.com/mate-desktop/engrampa/issues/210
Diffstat (limited to 'src/fr-command-zip.c')
-rw-r--r-- | src/fr-command-zip.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/fr-command-zip.c b/src/fr-command-zip.c index a5326ba..387f27c 100644 --- a/src/fr-command-zip.c +++ b/src/fr-command-zip.c @@ -392,13 +392,24 @@ const char *zip_mime_type[] = { "application/x-ear", "application/x-ms-dos-executable", "application/x-war", - "application/zip", - NULL }; + "application/zip", /* zip always at the end and the number of */ + NULL }; /* place in fr_command_zip_get_mime_types */ static const char ** fr_command_zip_get_mime_types (FrCommand *comm) { + GSettings *settings; + settings = g_settings_new ("org.mate.engrampa.general"); + + if (g_settings_get_boolean (settings, "unar-open-zip") && + is_program_in_path ("unar") && is_program_in_path ("lsar")) + zip_mime_type [10] = NULL; + else + g_settings_set_boolean (settings, "unar-open-zip", FALSE); + + g_object_unref (settings); + return zip_mime_type; } |