[file-roller: 40/123] removed the action attribute from archive
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller: 40/123] removed the action attribute from archive
- Date: Mon, 6 Aug 2012 13:44:14 +0000 (UTC)
commit 99ead8a3e449a90c836cce3bed42ab19ffeedd9d
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sat Jul 21 09:02:45 2012 +0200
removed the action attribute from archive
src/fr-archive.c | 1 -
src/fr-archive.h | 1 -
src/fr-command-zip.c | 24 +++++++++++++-----------
src/fr-command.c | 13 -------------
4 files changed, 13 insertions(+), 26 deletions(-)
---
diff --git a/src/fr-archive.c b/src/fr-archive.c
index 61cc628..996f1f9 100644
--- a/src/fr-archive.c
+++ b/src/fr-archive.c
@@ -411,7 +411,6 @@ fr_archive_init (FrArchive *self)
self->multi_volume = FALSE;
self->volume_size = 0;
self->read_only = FALSE;
- self->action = FR_ACTION_NONE;
self->extract_here = FALSE;
self->n_file = 0;
self->n_files = 0;
diff --git a/src/fr-archive.h b/src/fr-archive.h
index 6d7f9e2..7fd650c 100644
--- a/src/fr-archive.h
+++ b/src/fr-archive.h
@@ -89,7 +89,6 @@ struct _FrArchive {
/*<protected>*/
/* FIXME: remove this two attributes */
- FrAction action; /* current action. */
gboolean extract_here;
/* progress data */
diff --git a/src/fr-command-zip.c b/src/fr-command-zip.c
index efc9578..8299263 100644
--- a/src/fr-command-zip.c
+++ b/src/fr-command-zip.c
@@ -348,26 +348,28 @@ static void
fr_command_zip_handle_error (FrCommand *comm,
FrError *error)
{
- if (error->type != FR_ERROR_NONE) {
- if (error->status <= 1)
- error->type = FR_ERROR_NONE;
- else if ((error->status == 82) || (error->status == 5))
- error->type = FR_ERROR_ASK_PASSWORD;
- else {
+ if (error->type == FR_ERROR_NONE)
+ return;
+
+ if (error->status <= 1)
+ error->type = FR_ERROR_NONE;
+ else if ((error->status == 82) || (error->status == 5))
+ error->type = FR_ERROR_ASK_PASSWORD;
+ else {
+ int i;
+
+ for (i = 1; i <= 2; i++) {
GList *output;
GList *scan;
- if (FR_ARCHIVE (comm)->action == FR_ACTION_TESTING_ARCHIVE)
- output = comm->process->out.raw;
- else
- output = comm->process->err.raw;
+ output = (i == 1) ? comm->process->err.raw : comm->process->out.raw;
for (scan = g_list_last (output); scan; scan = scan->prev) {
char *line = scan->data;
if (strstr (line, "incorrect password") != NULL) {
error->type = FR_ERROR_ASK_PASSWORD;
- break;
+ return;
}
}
}
diff --git a/src/fr-command.c b/src/fr-command.c
index 3913873..860b8d0 100644
--- a/src/fr-command.c
+++ b/src/fr-command.c
@@ -406,9 +406,6 @@ fr_command_add (FrCommand *self,
gboolean update,
gboolean recursive)
{
- FrArchive *archive = FR_ARCHIVE (self);
-
- archive->action = FR_ACTION_ADDING_FILES;
fr_process_set_out_line_func (self->process, NULL, NULL);
fr_process_set_err_line_func (self->process, NULL, NULL);
@@ -426,9 +423,6 @@ fr_command_delete (FrCommand *self,
const char *from_file,
GList *file_list)
{
- FrArchive *archive = FR_ARCHIVE (self);
-
- archive->action = FR_ACTION_DELETING_FILES;
fr_process_set_out_line_func (self->process, NULL, NULL);
fr_process_set_err_line_func (self->process, NULL, NULL);
@@ -445,9 +439,6 @@ fr_command_extract (FrCommand *self,
gboolean skip_older,
gboolean junk_paths)
{
- FrArchive *archive = FR_ARCHIVE (self);
-
- archive->action = FR_ACTION_EXTRACTING_FILES;
fr_process_set_out_line_func (self->process, NULL, NULL);
fr_process_set_err_line_func (self->process, NULL, NULL);
@@ -464,9 +455,6 @@ fr_command_extract (FrCommand *self,
static void
fr_command_test (FrCommand *self)
{
- FrArchive *archive = FR_ARCHIVE (self);
-
- archive->action = FR_ACTION_TESTING_ARCHIVE;
fr_process_set_out_line_func (self->process, NULL, NULL);
fr_process_set_err_line_func (self->process, NULL, NULL);
@@ -760,7 +748,6 @@ load_local_archive (LoadData *load_data)
{
FrCommand *self = FR_COMMAND (load_data->archive);
- load_data->archive->action = FR_ACTION_LISTING_CONTENT;
fr_process_set_out_line_func (self->process, NULL, NULL);
fr_process_set_err_line_func (self->process, NULL, NULL);
fr_process_use_standard_locale (self->process, TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]