[file-roller] changed error logic



commit d8645fd9cc08843e35b70c588376b6d7d419e5a3
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Jul 26 09:05:35 2009 +0200

    changed error logic
    
    an error occurs if the type is not FR_PROC_ERROR_NONE

 src/fr-command-arj.c     |    2 +-
 src/fr-command-rar.c     |    6 +++---
 src/fr-command-tar.c     |    2 +-
 src/fr-command-unstuff.c |    6 ++++--
 src/fr-command-zip.c     |    8 ++++----
 5 files changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/src/fr-command-arj.c b/src/fr-command-arj.c
index 9e1db99..6699c09 100644
--- a/src/fr-command-arj.c
+++ b/src/fr-command-arj.c
@@ -307,7 +307,7 @@ static void
 fr_command_arj_handle_error (FrCommand   *comm,
 			     FrProcError *error)
 {
-	if (error->type == FR_PROC_ERROR_COMMAND_ERROR) {
+	if (error->type != FR_PROC_ERROR_NONE) {
  		if (error->status <= 1)
  			error->type = FR_PROC_ERROR_NONE;
 		else if (error->status == 3)
diff --git a/src/fr-command-rar.c b/src/fr-command-rar.c
index b7e0a67..bf4d6fd 100644
--- a/src/fr-command-rar.c
+++ b/src/fr-command-rar.c
@@ -318,7 +318,7 @@ static void
 list__begin (gpointer data)
 {
 	FrCommandRar *comm = data;
-	
+
 	comm->list_started = FALSE;
 }
 
@@ -572,7 +572,7 @@ fr_command_rar_extract (FrCommand  *comm,
 		fr_process_begin_command (comm->process, "unrar");
 
 	fr_process_add_arg (comm->process, "x");
-	
+
 	/* keep broken extracted files */
 	fr_process_add_arg (comm->process, "-kb");
 
@@ -646,7 +646,7 @@ fr_command_rar_handle_error (FrCommand   *comm,
 	}
 #endif
 
-	if (error->type != FR_PROC_ERROR_COMMAND_ERROR)
+	if (error->type == FR_PROC_ERROR_NONE)
 		return;
 
 	/*if (error->status == 3)
diff --git a/src/fr-command-tar.c b/src/fr-command-tar.c
index 94ad0bd..fc72455 100644
--- a/src/fr-command-tar.c
+++ b/src/fr-command-tar.c
@@ -935,7 +935,7 @@ static void
 fr_command_tar_handle_error (FrCommand   *comm,
 			     FrProcError *error)
 {
-	if (error->type == FR_PROC_ERROR_COMMAND_ERROR) {
+	if (error->type != FR_PROC_ERROR_NONE) {
 		if (error->status <= 1)
 			error->type = FR_PROC_ERROR_NONE;
 	}
diff --git a/src/fr-command-unstuff.c b/src/fr-command-unstuff.c
index 02a470e..99114ba 100644
--- a/src/fr-command-unstuff.c
+++ b/src/fr-command-unstuff.c
@@ -183,7 +183,7 @@ static void
 list__begin (gpointer data)
 {
 	FrCommandUnstuff *comm = data;
-	
+
 	comm->fdata = NULL;
 }
 
@@ -268,9 +268,11 @@ static void
 fr_command_unstuff_handle_error (FrCommand   *comm,
 				 FrProcError *error)
 {
-	if ((error->type == FR_PROC_ERROR_COMMAND_ERROR)
+	if ((error->type != FR_PROC_ERROR_NONE)
 	    && (error->status <= 1))
+	{
 		error->type = FR_PROC_ERROR_NONE;
+	}
 }
 
 
diff --git a/src/fr-command-zip.c b/src/fr-command-zip.c
index 3ff1fbc..39382c0 100644
--- a/src/fr-command-zip.c
+++ b/src/fr-command-zip.c
@@ -177,7 +177,7 @@ static void
 list__begin (gpointer data)
 {
 	FrCommandZip *comm = data;
-	
+
 	comm->is_empty = FALSE;
 }
 
@@ -277,7 +277,7 @@ fr_command_zip_delete (FrCommand  *comm,
 	fr_process_add_arg (comm->process, comm->filename);
 	for (scan = file_list; scan; scan = scan->next) {
 		char *escaped;
-		
+
  		escaped = escape_str (scan->data, ZIP_SPECIAL_CHARACTERS);
  		fr_process_add_arg (comm->process, escaped);
  		g_free (escaped);
@@ -321,7 +321,7 @@ fr_command_zip_extract (FrCommand  *comm,
 	fr_process_add_arg (comm->process, comm->filename);
 	for (scan = file_list; scan; scan = scan->next) {
 		char *escaped;
-		
+
  		escaped = escape_str (scan->data, ZIP_SPECIAL_CHARACTERS);
  		fr_process_add_arg (comm->process, escaped);
  		g_free (escaped);
@@ -346,7 +346,7 @@ static void
 fr_command_zip_handle_error (FrCommand   *comm,
 			     FrProcError *error)
 {
-	if (error->type == FR_PROC_ERROR_COMMAND_ERROR) {
+	if (error->type != FR_PROC_ERROR_NONE) {
 		if (error->status <= 1)
 			error->type = FR_PROC_ERROR_NONE;
 		else if ((error->status == 82) || (error->status == 5))



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