Ejemplo n.º 1
0
static FrCommandCap
fr_command_unarchiver_get_capabilities (FrCommand  *comm,
					const char *mime_type,
					gboolean    check_command)
{
	FrCommandCap capabilities;

	capabilities = FR_COMMAND_CAN_DO_NOTHING;
	if (is_program_available ("lsar", check_command) && is_program_available ("unar", check_command))
		capabilities |= FR_COMMAND_CAN_READ;

	return capabilities;
}
FrCommandCap
fr_command_cfile_get_capabilities (FrCommand  *comm,
			           const char *mime_type,
				   gboolean    check_command)
{
	FrCommandCap capabilities;

	capabilities = FR_COMMAND_CAN_DO_NOTHING;
	if (is_mime_type (mime_type, "application/x-gzip")) {
		if (is_program_available ("gzip", check_command))
			capabilities |= FR_COMMAND_CAN_READ_WRITE;
	}
	else if (is_mime_type (mime_type, "application/x-bzip")) {
		if (is_program_available ("bzip2", check_command))
			capabilities |= FR_COMMAND_CAN_READ_WRITE;
	}
	else if (is_mime_type (mime_type, "application/x-compress")) {
		if (is_program_available ("compress", check_command))
			capabilities |= FR_COMMAND_CAN_WRITE;
		if (is_program_available ("uncompress", check_command) || is_program_available ("gzip", check_command))
			capabilities |= FR_COMMAND_CAN_READ;
	}
	else if (is_mime_type (mime_type, "application/x-lzip")) {
		if (is_program_available ("lzip", check_command))
			capabilities |= FR_COMMAND_CAN_READ_WRITE;
	}
	else if (is_mime_type (mime_type, "application/x-lzma")) {
		if (is_program_available ("lzma", check_command))
			capabilities |= FR_COMMAND_CAN_READ_WRITE;
	}
	else if (is_mime_type (mime_type, "application/x-xz")) {
		if (is_program_available ("xz", check_command))
			capabilities |= FR_COMMAND_CAN_READ_WRITE;
	}
	else if (is_mime_type (mime_type, "application/x-lzop")) {
		if (is_program_available ("lzop", check_command))
			capabilities |= FR_COMMAND_CAN_READ_WRITE;
	}
	else if (is_mime_type (mime_type, "application/x-rzip")) {
		if (is_program_available ("rzip", check_command))
			capabilities |= FR_COMMAND_CAN_READ_WRITE;
	}

	return capabilities;
}
Ejemplo n.º 3
0
FrCommandCap
fr_command_zip_get_capabilities (FrCommand  *comm,
			         const char *mime_type,
				 gboolean    check_command)
{
	FrCommandCap capabilities;

	capabilities = FR_COMMAND_CAN_ARCHIVE_MANY_FILES | FR_COMMAND_CAN_ENCRYPT;
	if (is_program_available ("zip", check_command)) {
		if (strcmp (mime_type, "application/x-ms-dos-executable") == 0)
			capabilities |= FR_COMMAND_CAN_READ;
		else
			capabilities |= FR_COMMAND_CAN_READ_WRITE;
	}
	else if (is_program_available ("unzip", check_command))
		capabilities |= FR_COMMAND_CAN_READ;

	return capabilities;
}
Ejemplo n.º 4
0
static FrCommandCap
fr_command_zoo_get_capabilities (FrCommand  *comm,
			         const char *mime_type,
				 gboolean    check_command)
{
	FrCommandCap capabilities;

	capabilities = FR_COMMAND_CAN_ARCHIVE_MANY_FILES;
	if (is_program_available ("zoo", check_command))
		capabilities |= FR_COMMAND_CAN_READ_WRITE;

	return capabilities;
}
Ejemplo n.º 5
0
static FrCommandCap
fr_command_ar_get_capabilities (FrCommand  *comm,
			        const char *mime_type,
				gboolean    check_command)
{
	FrCommandCap capabilities;

	capabilities = FR_COMMAND_CAN_ARCHIVE_MANY_FILES;
	if (is_program_available ("ar", check_command)) {
		if (is_mime_type (mime_type, "application/x-deb"))
			capabilities |= FR_COMMAND_CAN_READ;
		else if (is_mime_type (mime_type, "application/x-ar"))
			capabilities |= FR_COMMAND_CAN_READ_WRITE;
	}

	return capabilities;
}