file-roller r2433 - in trunk: . src
- From: paobac svn gnome org
- To: svn-commits-list gnome org
- Subject: file-roller r2433 - in trunk: . src
- Date: Sun, 17 Aug 2008 08:02:56 +0000 (UTC)
Author: paobac
Date: Sun Aug 17 08:02:55 2008
New Revision: 2433
URL: http://svn.gnome.org/viewvc/file-roller?rev=2433&view=rev
Log:
2008-08-17 Paolo Bacchilega <paobac svn gnome org>
* src/fr-command-cfile.c: allow to read .Z files with gzip.
* src/fr-command-tar.c: allow to read tar.Z files with gzip.
Fixes bug: file-roller fails to open .Z files (LP#26662).
* src/file-utils.c (is_mime_type): campare the whole string not only
part of it.
Modified:
trunk/ChangeLog
trunk/TODO
trunk/src/file-utils.c
trunk/src/fr-command-cfile.c
trunk/src/fr-command-tar.c
Modified: trunk/TODO
==============================================================================
--- trunk/TODO (original)
+++ trunk/TODO Sun Aug 17 08:02:55 2008
@@ -25,7 +25,9 @@
[ ] #547982 â Failure dialog for file extraction should be more useful
-[ ] #350640 â sending an empty folder doesn't work
+[x] #350640 â sending an empty folder doesn't work
+
+[x] LP#26662: file-roller fails to open .Z files
== DONE ==
Modified: trunk/src/file-utils.c
==============================================================================
--- trunk/src/file-utils.c (original)
+++ trunk/src/file-utils.c Sun Aug 17 08:02:55 2008
@@ -703,7 +703,7 @@
is_mime_type (const char *mime_type,
const char *pattern)
{
- return (strncasecmp (mime_type, pattern, strlen (pattern)) == 0);
+ return (strcasecmp (mime_type, pattern) == 0);
}
Modified: trunk/src/fr-command-cfile.c
==============================================================================
--- trunk/src/fr-command-cfile.c (original)
+++ trunk/src/fr-command-cfile.c Sun Aug 17 08:02:55 2008
@@ -356,7 +356,13 @@
fr_process_end_command (comm->process);
}
else if (is_mime_type (comm->mime_type, "application/x-compress")) {
- fr_process_begin_command (comm->process, "uncompress");
+ if (is_program_in_path ("gzip")) {
+ fr_process_begin_command (comm->process, "gzip");
+ fr_process_add_arg (comm->process, "-d");
+ fr_process_add_arg (comm->process, "-n");
+ }
+ else
+ fr_process_begin_command (comm->process, "uncompress");
fr_process_add_arg (comm->process, "-f");
fr_process_add_arg (comm->process, temp_file);
fr_process_end_command (comm->process);
@@ -453,7 +459,7 @@
else if (is_mime_type (mime_type, "application/x-compress")) {
if (is_program_in_path ("compress"))
capabilities |= FR_COMMAND_CAN_WRITE;
- if (is_program_in_path ("uncompress"))
+ if (is_program_in_path ("uncompress") || is_program_in_path ("gzip"))
capabilities |= FR_COMMAND_CAN_READ;
}
else if (is_mime_type (mime_type, "application/x-lzma")) {
Modified: trunk/src/fr-command-tar.c
==============================================================================
--- trunk/src/fr-command-tar.c (original)
+++ trunk/src/fr-command-tar.c Sun Aug 17 08:02:55 2008
@@ -197,9 +197,12 @@
else if (is_mime_type (comm->mime_type, "application/x-bzip-compressed-tar"))
fr_process_add_arg (comm->process, "--use-compress-program=bzip2");
- else if (is_mime_type (comm->mime_type, "application/x-tarz"))
- fr_process_add_arg (comm->process, "-Z");
-
+ else if (is_mime_type (comm->mime_type, "application/x-tarz")) {
+ if (is_program_in_path ("gzip"))
+ fr_process_add_arg (comm->process, "-z");
+ else
+ fr_process_add_arg (comm->process, "-Z");
+ }
else if (is_mime_type (comm->mime_type, "application/x-lzma-compressed-tar"))
fr_process_add_arg (comm->process, "--use-compress-program=lzma");
@@ -209,6 +212,7 @@
else if (is_mime_type (comm->mime_type, "application/x-7z-compressed-tar")) {
FrCommandTar *comm_tar = (FrCommandTar*) comm;
char *option;
+
option = g_strdup_printf ("--use-compress-program=%s", comm_tar->compress_command);
fr_process_add_arg (comm->process, option);
g_free (option);
@@ -780,7 +784,10 @@
fr_process_end_command (comm->process);
}
else if (is_mime_type (comm->mime_type, "application/x-tarz")) {
- fr_process_begin_command (comm->process, "uncompress");
+ if (is_program_in_path ("gzip"))
+ fr_process_begin_command (comm->process, "gzip");
+ else
+ fr_process_begin_command (comm->process, "uncompress");
fr_process_set_begin_func (comm->process, begin_func__uncompress, comm);
fr_process_add_arg (comm->process, "-f");
fr_process_add_arg (comm->process, tmp_name);
@@ -878,11 +885,11 @@
if (is_program_in_path ("bzip2"))
capabilities |= FR_COMMAND_CAN_READ_WRITE;
}
- else if (is_mime_type (mime_type, "application/x-tarz")) {
- if (is_program_in_path ("compress"))
- capabilities |= FR_COMMAND_CAN_WRITE;
- if (is_program_in_path ("uncompress"))
- capabilities |= FR_COMMAND_CAN_READ;
+ else if (is_mime_type (mime_type, "application/x-tarz")) {
+ if (is_program_in_path ("compress") && is_program_in_path ("uncompress"))
+ capabilities |= FR_COMMAND_CAN_READ_WRITE;
+ else if (is_program_in_path ("gzip"))
+ capabilities |= FR_COMMAND_CAN_READ;
}
else if (is_mime_type (mime_type, "application/x-lzma-compressed-tar")) {
if (is_program_in_path ("lzma"))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]