コード例 #1
0
static void
begin_func__delete (gpointer data)
{
    FrCommand *comm = data;
    fr_command_progress (comm, -1.0);
    fr_command_message (comm, _("Deleting files from archive"));
}
コード例 #2
0
static void
begin_func__uncompress (gpointer data)
{
    FrCommand *comm = data;
    fr_command_progress (comm, -1.0);
    fr_command_message (comm, _("Decompressing archive"));
}
コード例 #3
0
static void
process_line__common (char     *line,
		      gpointer  data)
{
	FrCommand  *comm = FR_COMMAND (data);

	if (line == NULL)
		return;

	fr_command_message (comm, line);

	if (comm->n_files != 0) {
		double fraction = (double) ++comm->n_file / (comm->n_files + 1);
		fr_command_progress (comm, fraction);
	}
}
コード例 #4
0
static void
process_line__extract (char     *line,
		       gpointer  data)
{
	FrCommand           *comm = FR_COMMAND (data);
	FrCommandUnarchiver *unar_comm = FR_COMMAND_UNARCHIVER (comm);

	if (line == NULL)
		return;

	unar_comm->n_line++;

	/* the first line is the name of the archive */
	if (unar_comm->n_line == 1)
		return;

	if (comm->n_files > 1) {
		double fraction = (double) ++comm->n_file / (comm->n_files + 1);
		fr_command_progress (comm, CLAMP (fraction, 0.0, 1.0));
	}
	else
		fr_command_message (comm, line);
}
コード例 #5
0
static void
process_line__generic (char     *line,
                       gpointer  data,
                       char     *action_msg)
{
    FrCommand *comm = FR_COMMAND (data);
    char      *msg;

    if (line == NULL)
        return;

    if (line[strlen (line) - 1] == '/') /* ignore directories */
        return;

    msg = g_strconcat (action_msg, file_name_from_path (line), NULL);
    fr_command_message (comm, msg);
    g_free (msg);

    if (comm->n_files != 0) {
        double fraction = (double) ++comm->n_file / (comm->n_files + 1);
        fr_command_progress (comm, fraction);
    }
}