diff options
Diffstat (limited to 'src/fr-command-cfile.c')
-rw-r--r-- | src/fr-command-cfile.c | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/src/fr-command-cfile.c b/src/fr-command-cfile.c index a914abe..52b023a 100644 --- a/src/fr-command-cfile.c +++ b/src/fr-command-cfile.c @@ -37,12 +37,10 @@ #include "fr-command.h" #include "fr-command-cfile.h" - /* Parent Class */ static FrCommandClass *parent_class = NULL; - static char * get_uncompressed_name_from_archive (FrCommand *comm, const char *archive) @@ -94,7 +92,6 @@ get_uncompressed_name_from_archive (FrCommand *comm, return filename; } - static void list__process_line (char *line, gpointer data) @@ -136,7 +133,6 @@ list__process_line (char *line, fr_command_add_file (comm, fdata); } - static void fr_command_cfile_list (FrCommand *comm) { @@ -194,7 +190,6 @@ fr_command_cfile_list (FrCommand *comm) } } - static void fr_command_cfile_add (FrCommand *comm, const char *from_file, @@ -301,7 +296,8 @@ fr_command_cfile_add (FrCommand *comm, compressed_filename = g_strconcat (filename, ".rz", NULL); } - else if (is_mime_type (comm->mime_type, ZSTD_MIME_TYPE)) { + else if (is_mime_type (comm->mime_type, "application/zstd") + || is_mime_type (comm->mime_type, "application/x-zstd")) { fr_process_begin_command (comm->process, "zstd"); fr_process_set_working_dir (comm->process, temp_dir); fr_process_add_arg (comm->process, filename); @@ -333,7 +329,6 @@ fr_command_cfile_add (FrCommand *comm, g_free (temp_dir); } - static void fr_command_cfile_delete (FrCommand *comm, const char *from_file, @@ -342,7 +337,6 @@ fr_command_cfile_delete (FrCommand *comm, /* never called */ } - static void fr_command_cfile_extract (FrCommand *comm, const char *from_file, @@ -446,7 +440,8 @@ fr_command_cfile_extract (FrCommand *comm, fr_process_end_command (comm->process); } - else if (is_mime_type (comm->mime_type, ZSTD_MIME_TYPE)) { + else if (is_mime_type (comm->mime_type, "application/zstd") + || is_mime_type (comm->mime_type, "application/x-zstd")) { fr_process_begin_command (comm->process, "zstd"); fr_process_add_arg (comm->process, "-f"); fr_process_add_arg (comm->process, "-d"); @@ -515,7 +510,8 @@ fr_command_cfile_test (FrCommand *comm) else if (is_mime_type (comm->mime_type, "application/x-lzop")) { compress_cmd = "lzop"; } - else if (is_mime_type (comm->mime_type, ZSTD_MIME_TYPE)) { + else if (is_mime_type (comm->mime_type, "application/zstd") + || is_mime_type (comm->mime_type, "application/x-zstd")) { compress_cmd = "zstd"; fr_process_begin_command (comm->process, compress_cmd); fr_process_add_arg (comm->process, "-v"); @@ -542,23 +538,22 @@ const char *cfile_mime_type[] = { "application/x-gzip", "application/x-lzop", "application/x-rzip", "application/x-xz", - ZSTD_MIME_TYPE, + "application/zstd", + "application/x-zstd", NULL }; - static const char ** fr_command_cfile_get_mime_types (FrCommand *comm) { return cfile_mime_type; } - -static FrCommandCap +static FrCommandCaps fr_command_cfile_get_capabilities (FrCommand *comm, const char *mime_type, gboolean check_command) { - FrCommandCap capabilities; + FrCommandCaps capabilities; capabilities = FR_COMMAND_CAN_DO_NOTHING; if (is_mime_type (mime_type, "application/x-gzip")) { @@ -599,7 +594,8 @@ fr_command_cfile_get_capabilities (FrCommand *comm, if (is_program_available ("rzip", check_command)) capabilities |= FR_COMMAND_CAN_READ_WRITE; } - else if (is_mime_type (mime_type, ZSTD_MIME_TYPE)) { + else if (is_mime_type (mime_type, "application/zstd") + || is_mime_type (mime_type, "application/x-zstd")) { if (is_program_available ("zstd", check_command)) capabilities |= FR_COMMAND_CAN_READ_WRITE; } @@ -607,7 +603,6 @@ fr_command_cfile_get_capabilities (FrCommand *comm, return capabilities; } - static void fr_command_cfile_finalize (GObject *object) { @@ -619,7 +614,6 @@ fr_command_cfile_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); } - static const char * fr_command_cfile_get_packages (FrCommand *comm, const char *mime_type) @@ -642,13 +636,13 @@ fr_command_cfile_get_packages (FrCommand *comm, return PACKAGES ("lzop"); else if (is_mime_type (mime_type, "application/x-rzip")) return PACKAGES ("rzip"); - else if (is_mime_type (mime_type, ZSTD_MIME_TYPE)) + else if (is_mime_type (mime_type, "application/zstd") + || is_mime_type (mime_type, "application/x-zstd")) return PACKAGES ("zstd"); return NULL; } - static void fr_command_cfile_class_init (FrCommandCFileClass *class) { @@ -670,7 +664,6 @@ fr_command_cfile_class_init (FrCommandCFileClass *class) afc->get_packages = fr_command_cfile_get_packages; } - static void fr_command_cfile_init (FrCommand *comm) { @@ -683,7 +676,6 @@ fr_command_cfile_init (FrCommand *comm) comm->propTest = TRUE; } - GType fr_command_cfile_get_type () { |