summaryrefslogtreecommitdiff
path: root/src/fr-command.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fr-command.c')
-rw-r--r--src/fr-command.c59
1 files changed, 10 insertions, 49 deletions
diff --git a/src/fr-command.c b/src/fr-command.c
index 163f277..dcbe9ad 100644
--- a/src/fr-command.c
+++ b/src/fr-command.c
@@ -36,7 +36,6 @@
#define INITIAL_SIZE 256
-
/* Signals */
enum {
START,
@@ -80,7 +79,7 @@ const char *action_names[] = { "NONE",
"CREATING_ARCHIVE",
"SAVING_REMOTE_ARCHIVE" };
-#if MATE_ENABLE_DEBUG
+#ifdef MATE_ENABLE_DEBUG
const char * get_action_name (FrAction action)
{
return action_names[action];
@@ -115,13 +114,11 @@ fr_command_get_type ()
return type;
}
-
static void
base_fr_command_list (FrCommand *comm)
{
}
-
static void
base_fr_command_add (FrCommand *comm,
const char *from_file,
@@ -132,7 +129,6 @@ base_fr_command_add (FrCommand *comm,
{
}
-
static void
base_fr_command_delete (FrCommand *comm,
const char *from_file,
@@ -140,7 +136,6 @@ base_fr_command_delete (FrCommand *comm,
{
}
-
static void
base_fr_command_extract (FrCommand *comm,
const char *from_file,
@@ -152,43 +147,36 @@ base_fr_command_extract (FrCommand *comm,
{
}
-
static void
base_fr_command_test (FrCommand *comm)
{
}
-
static void
base_fr_command_uncompress (FrCommand *comm)
{
}
-
static void
base_fr_command_recompress (FrCommand *comm)
{
}
-
static void
base_fr_command_handle_error (FrCommand *comm,
FrProcError *error)
{
}
-
const char **void_mime_types = { NULL };
-
static const char **
base_fr_command_get_mime_types (FrCommand *comm)
{
return void_mime_types;
}
-
-static FrCommandCap
+static FrCommandCaps
base_fr_command_get_capabilities (FrCommand *comm,
const char *mime_type,
gboolean check_command)
@@ -196,7 +184,6 @@ base_fr_command_get_capabilities (FrCommand *comm,
return FR_COMMAND_CAN_DO_NOTHING;
}
-
static void
base_fr_command_set_mime_type (FrCommand *comm,
const char *mime_type)
@@ -205,7 +192,6 @@ base_fr_command_set_mime_type (FrCommand *comm,
fr_command_update_capabilities (comm);
}
-
static const char *
base_fr_command_get_packages (FrCommand *comm,
const char *mime_type)
@@ -213,7 +199,6 @@ base_fr_command_get_packages (FrCommand *comm,
return NULL;
}
-
static void
fr_command_start (FrProcess *process,
gpointer data)
@@ -226,7 +211,6 @@ fr_command_start (FrProcess *process,
comm->action);
}
-
static void
fr_command_done (FrProcess *process,
FrProcError *error,
@@ -255,7 +239,6 @@ fr_command_done (FrProcess *process,
error);
}
-
static void
fr_command_set_process (FrCommand *comm,
FrProcess *process)
@@ -286,7 +269,6 @@ fr_command_set_process (FrCommand *comm,
comm);
}
-
static void
fr_command_set_property (GObject *object,
guint prop_id,
@@ -325,7 +307,6 @@ fr_command_set_property (GObject *object,
}
}
-
static void
fr_command_get_property (GObject *object,
guint prop_id,
@@ -364,7 +345,6 @@ fr_command_get_property (GObject *object,
}
}
-
static void
fr_command_class_init (FrCommandClass *class)
{
@@ -502,7 +482,6 @@ fr_command_class_init (FrCommandClass *class)
G_PARAM_READWRITE));
}
-
static void
fr_command_init (FrCommand *comm)
{
@@ -530,7 +509,6 @@ fr_command_init (FrCommand *comm)
comm->propListFromFile = FALSE;
}
-
static void
fr_command_finalize (GObject *object)
{
@@ -553,7 +531,6 @@ fr_command_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
-
static void
fr_command_set_filename (FrCommand *comm,
const char *filename)
@@ -593,7 +570,6 @@ fr_command_set_filename (FrCommand *comm,
fr_command_working_archive (comm, comm->filename);
}
-
void
fr_command_set_file (FrCommand *comm,
GFile *file)
@@ -606,7 +582,6 @@ fr_command_set_file (FrCommand *comm,
g_free (filename);
}
-
void
fr_command_set_multi_volume (FrCommand *comm,
GFile *file)
@@ -615,7 +590,6 @@ fr_command_set_multi_volume (FrCommand *comm,
fr_command_set_file (comm, file);
}
-
void
fr_command_list (FrCommand *comm)
{
@@ -634,17 +608,21 @@ fr_command_list (FrCommand *comm)
fr_process_use_standard_locale (comm->process, TRUE);
comm->multi_volume = FALSE;
- if (! comm->fake_load)
+ if (! comm->fake_load) {
FR_COMMAND_GET_CLASS (G_OBJECT (comm))->list (comm);
- else
+ } else {
+ comm->process->error.type = FR_PROC_ERROR_NONE;
+ comm->process->error.status = 0;
+ g_clear_error (&comm->process->error.gerror);
+
g_signal_emit (G_OBJECT (comm),
fr_command_signals[DONE],
0,
comm->action,
&comm->process->error);
+ }
}
-
void
fr_command_add (FrCommand *comm,
const char *from_file,
@@ -667,7 +645,6 @@ fr_command_add (FrCommand *comm,
recursive);
}
-
void
fr_command_delete (FrCommand *comm,
const char *from_file,
@@ -682,7 +659,6 @@ fr_command_delete (FrCommand *comm,
FR_COMMAND_GET_CLASS (G_OBJECT (comm))->delete (comm, from_file, file_list);
}
-
void
fr_command_extract (FrCommand *comm,
const char *from_file,
@@ -707,7 +683,6 @@ fr_command_extract (FrCommand *comm,
junk_paths);
}
-
void
fr_command_test (FrCommand *comm)
{
@@ -720,7 +695,6 @@ fr_command_test (FrCommand *comm)
FR_COMMAND_GET_CLASS (G_OBJECT (comm))->test (comm);
}
-
void
fr_command_uncompress (FrCommand *comm)
{
@@ -728,7 +702,6 @@ fr_command_uncompress (FrCommand *comm)
FR_COMMAND_GET_CLASS (G_OBJECT (comm))->uncompress (comm);
}
-
void
fr_command_recompress (FrCommand *comm)
{
@@ -736,22 +709,19 @@ fr_command_recompress (FrCommand *comm)
FR_COMMAND_GET_CLASS (G_OBJECT (comm))->recompress (comm);
}
-
const char **
fr_command_get_mime_types (FrCommand *comm)
{
return FR_COMMAND_GET_CLASS (G_OBJECT (comm))->get_mime_types (comm);
}
-
void
fr_command_update_capabilities (FrCommand *comm)
{
comm->capabilities = fr_command_get_capabilities (comm, comm->mime_type, TRUE);
}
-
-FrCommandCap
+FrCommandCaps
fr_command_get_capabilities (FrCommand *comm,
const char *mime_type,
gboolean check_command)
@@ -759,7 +729,6 @@ fr_command_get_capabilities (FrCommand *comm,
return FR_COMMAND_GET_CLASS (G_OBJECT (comm))->get_capabilities (comm, mime_type, check_command);
}
-
gboolean
fr_command_is_capable_of (FrCommand *comm,
FrCommandCaps requested_capabilities)
@@ -767,7 +736,6 @@ fr_command_is_capable_of (FrCommand *comm,
return (((comm->capabilities ^ requested_capabilities) & requested_capabilities) == 0);
}
-
const char *
fr_command_get_packages (FrCommand *comm,
const char *mime_type)
@@ -775,7 +743,6 @@ fr_command_get_packages (FrCommand *comm,
return FR_COMMAND_GET_CLASS (G_OBJECT (comm))->get_packages (comm, mime_type);
}
-
/* fraction == -1 means : I don't known how much time the current operation
* will take, the dialog will display this info pulsing
* the progress bar.
@@ -792,7 +759,6 @@ fr_command_progress (FrCommand *comm,
fraction);
}
-
void
fr_command_message (FrCommand *comm,
const char *msg)
@@ -803,7 +769,6 @@ fr_command_message (FrCommand *comm,
msg);
}
-
void
fr_command_working_archive (FrCommand *comm,
const char *archive_name)
@@ -814,7 +779,6 @@ fr_command_working_archive (FrCommand *comm,
archive_name);
}
-
void
fr_command_set_n_files (FrCommand *comm,
int n_files)
@@ -823,7 +787,6 @@ fr_command_set_n_files (FrCommand *comm,
comm->n_file = 0;
}
-
void
fr_command_add_file (FrCommand *comm,
FileData *fdata)
@@ -834,7 +797,6 @@ fr_command_add_file (FrCommand *comm,
comm->n_regular_files++;
}
-
void
fr_command_set_mime_type (FrCommand *comm,
const char *mime_type)
@@ -842,7 +804,6 @@ fr_command_set_mime_type (FrCommand *comm,
FR_COMMAND_GET_CLASS (G_OBJECT (comm))->set_mime_type (comm, mime_type);
}
-
void
fr_command_handle_error (FrCommand *comm,
FrProcError *error)