[file-roller] 7za doesn't support iso files



commit 7baa266aa0532cebdd08a362be6ac5f3da2fc1d8
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Tue Aug 18 09:46:55 2009 +0200

    7za doesn't support iso files

 src/Makefile.am      |    3 +++
 src/fr-command-7z.c  |   12 +++++++++++-
 src/fr-command-iso.c |    6 +++---
 3 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index e871437..32d07e8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -17,9 +17,11 @@ endif
 if RUN_IN_PLACE
 uidir = $(top_srcdir)/data/ui
 privexecdir = $(abs_top_builddir)/src/commands/
+shdir = $(top_srcdir)/src/sh/
 else
 uidir = $(datadir)/file-roller/ui
 privexecdir = $(libexecdir)/file-roller/
+shdir = $(libexecdir)/file-roller/
 endif
 
 INCLUDES =						\
@@ -35,6 +37,7 @@ INCLUDES =						\
 	-DPIXMAPSDIR=\""$(datadir)/pixmaps"\"		\
 	-DGLADEDIR=\""$(gladedir)"\" 			\
 	-DPRIVEXECDIR=\"$(privexecdir)\"		\
+	-DSHDIR=\"$(shdir)\"				\
 	$(DISABLE_DEPRECATED)				\
 	$(FR_CFLAGS)
 
diff --git a/src/fr-command-7z.c b/src/fr-command-7z.c
index 139efbe..ecc6f8c 100644
--- a/src/fr-command-7z.c
+++ b/src/fr-command-7z.c
@@ -545,7 +545,7 @@ fr_command_7z_get_capabilities (FrCommand  *comm,
 	else if (is_mime_type (mime_type, "application/x-7z-compressed-tar")) {
 		capabilities |= FR_COMMAND_CAN_READ_WRITE | FR_COMMAND_CAN_ENCRYPT | FR_COMMAND_CAN_ENCRYPT_HEADER | FR_COMMAND_CAN_CREATE_VOLUMES;
 	}
-	else if (is_program_in_path ("7z") || is_program_in_path ("7za")) {
+	else if (is_program_in_path ("7z")) {
 		if (is_mime_type (mime_type, "application/x-rar")
 		    || is_mime_type (mime_type, "application/x-cbr"))
 		{
@@ -562,6 +562,16 @@ fr_command_7z_get_capabilities (FrCommand  *comm,
 			capabilities |= FR_COMMAND_CAN_WRITE | FR_COMMAND_CAN_ENCRYPT;
 		}
 	}
+	else if (is_program_in_path ("7za")) {
+		if (is_mime_type (mime_type, "application/vnd.ms-cab-compressed")
+		    || is_mime_type (mime_type, "application/zip"))
+		{
+			capabilities |= FR_COMMAND_CAN_READ;
+		}
+
+		if (is_mime_type (mime_type, "application/zip"))
+			capabilities |= FR_COMMAND_CAN_WRITE;
+	}
 
 	/* multi-volumes are read-only */
 	if ((comm->files->len > 0) && comm->multi_volume && (capabilities & FR_COMMAND_CAN_WRITE))
diff --git a/src/fr-command-iso.c b/src/fr-command-iso.c
index 45688a2..998c006 100644
--- a/src/fr-command-iso.c
+++ b/src/fr-command-iso.c
@@ -131,7 +131,7 @@ static void
 list__begin (gpointer data)
 {
 	FrCommandIso *comm = data;
-	
+
 	g_free (comm->cur_path);
 	comm->cur_path = NULL;
 }
@@ -144,7 +144,7 @@ fr_command_iso_list (FrCommand *comm)
 
 	fr_process_begin_command (comm->process, "sh");
 	fr_process_set_begin_func (comm->process, list__begin, comm);
-	fr_process_add_arg (comm->process, PRIVEXECDIR "isoinfo.sh");
+	fr_process_add_arg (comm->process, SHDIR "isoinfo.sh");
 	fr_process_add_arg (comm->process, "-i");
 	fr_process_add_arg (comm->process, comm->filename);
 	fr_process_add_arg (comm->process, "-l");
@@ -186,7 +186,7 @@ fr_command_iso_extract (FrCommand  *comm,
 
 		fr_process_begin_command (comm->process, "sh");
 		fr_process_set_working_dir (comm->process, temp_dest_dir);
-		fr_process_add_arg (comm->process, PRIVEXECDIR "isoinfo.sh");
+		fr_process_add_arg (comm->process, SHDIR "isoinfo.sh");
 		fr_process_add_arg (comm->process, "-i");
 		fr_process_add_arg (comm->process, comm->filename);
 		fr_process_add_arg (comm->process, "-x");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]