(file_progress_show_count): remove 'done' and 'total' arguments.

Use members of 'ctx' instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2024-09-08 11:42:37 +03:00
parent 7c418111fd
commit 2b1a63aef3
3 changed files with 13 additions and 12 deletions

View File

@ -830,7 +830,7 @@ progress_update_one (file_op_context_t *ctx, off_t add)
{ {
if (verbose && ctx->dialog_type == FILEGUI_DIALOG_MULTI_ITEM) if (verbose && ctx->dialog_type == FILEGUI_DIALOG_MULTI_ITEM)
{ {
file_progress_show_count (ctx, ctx->total_progress_count, ctx->total_count); file_progress_show_count (ctx);
file_progress_show_total (ctx, ctx->progress_bytes, TRUE); file_progress_show_total (ctx, ctx->progress_bytes, TRUE);
} }
@ -1374,7 +1374,7 @@ erase_file (file_op_context_t *ctx, const vfs_path_t *vpath)
/* check buttons if deleting info was changed */ /* check buttons if deleting info was changed */
if (file_progress_show_deleting (ctx, vpath, &ctx->total_progress_count)) if (file_progress_show_deleting (ctx, vpath, &ctx->total_progress_count))
{ {
file_progress_show_count (ctx, ctx->total_progress_count, ctx->total_count); file_progress_show_count (ctx);
if (file_progress_check_buttons (ctx) == FILE_ABORT) if (file_progress_check_buttons (ctx) == FILE_ABORT)
return FILE_ABORT; return FILE_ABORT;
@ -1464,7 +1464,7 @@ recursive_erase (file_op_context_t *ctx, const vfs_path_t *vpath)
return FILE_ABORT; return FILE_ABORT;
file_progress_show_deleting (ctx, vpath, NULL); file_progress_show_deleting (ctx, vpath, NULL);
file_progress_show_count (ctx, ctx->total_progress_count, ctx->total_count); file_progress_show_count (ctx);
if (file_progress_check_buttons (ctx) == FILE_ABORT) if (file_progress_check_buttons (ctx) == FILE_ABORT)
return FILE_ABORT; return FILE_ABORT;
@ -1515,7 +1515,7 @@ static FileProgressStatus
erase_dir_iff_empty (file_op_context_t *ctx, const vfs_path_t *vpath) erase_dir_iff_empty (file_op_context_t *ctx, const vfs_path_t *vpath)
{ {
file_progress_show_deleting (ctx, vpath, NULL); file_progress_show_deleting (ctx, vpath, NULL);
file_progress_show_count (ctx, ctx->total_progress_count, ctx->total_count); file_progress_show_count (ctx);
if (file_progress_check_buttons (ctx) == FILE_ABORT) if (file_progress_check_buttons (ctx) == FILE_ABORT)
return FILE_ABORT; return FILE_ABORT;
@ -2758,7 +2758,7 @@ copy_file_file (file_op_context_t *ctx, const char *src_path, const char *dst_pa
force_update); force_update);
if (ctx->dialog_type == FILEGUI_DIALOG_MULTI_ITEM) if (ctx->dialog_type == FILEGUI_DIALOG_MULTI_ITEM)
{ {
file_progress_show_count (ctx, ctx->total_progress_count, ctx->total_count); file_progress_show_count (ctx);
file_progress_show_total (ctx, ctx->total_progress_bytes, force_update); file_progress_show_total (ctx, ctx->total_progress_bytes, force_update);
} }
@ -3277,7 +3277,7 @@ FileProgressStatus
erase_dir (file_op_context_t *ctx, const vfs_path_t *vpath) erase_dir (file_op_context_t *ctx, const vfs_path_t *vpath)
{ {
file_progress_show_deleting (ctx, vpath, NULL); file_progress_show_deleting (ctx, vpath, NULL);
file_progress_show_count (ctx, ctx->total_progress_count, ctx->total_count); file_progress_show_count (ctx);
if (file_progress_check_buttons (ctx) == FILE_ABORT) if (file_progress_check_buttons (ctx) == FILE_ABORT)
return FILE_ABORT; return FILE_ABORT;
@ -3626,7 +3626,7 @@ panel_operate (void *source_panel, FileOperation operation, gboolean force_singl
{ {
if (ctx->dialog_type == FILEGUI_DIALOG_MULTI_ITEM) if (ctx->dialog_type == FILEGUI_DIALOG_MULTI_ITEM)
{ {
file_progress_show_count (ctx, ctx->total_progress_count, ctx->total_count); file_progress_show_count (ctx);
file_progress_show_total (ctx, ctx->progress_bytes, FALSE); file_progress_show_total (ctx, ctx->progress_bytes, FALSE);
} }

View File

@ -1077,7 +1077,7 @@ file_progress_show (file_op_context_t *ctx, off_t done, off_t total,
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
void void
file_progress_show_count (file_op_context_t *ctx, size_t done, size_t total) file_progress_show_count (file_op_context_t *ctx)
{ {
file_progress_ui_t *ui; file_progress_ui_t *ui;
@ -1090,10 +1090,11 @@ file_progress_show_count (file_op_context_t *ctx, size_t done, size_t total)
return; return;
if (ctx->totals_computed) if (ctx->totals_computed)
label_set_textv (ui->total_files_processed_label, _("Files processed: %zu / %zu"), done, label_set_textv (ui->total_files_processed_label, _("Files processed: %zu / %zu"),
total); ctx->total_progress_count, ctx->total_count);
else else
label_set_textv (ui->total_files_processed_label, _("Files processed: %zu"), done); label_set_textv (ui->total_files_processed_label, _("Files processed: %zu"),
ctx->total_progress_count);
} }
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */

View File

@ -173,7 +173,7 @@ FileProgressStatus file_progress_check_buttons (file_op_context_t * ctx);
void file_progress_show (file_op_context_t * ctx, off_t done, off_t total, void file_progress_show (file_op_context_t * ctx, off_t done, off_t total,
const char *stalled_msg, gboolean force_update); const char *stalled_msg, gboolean force_update);
void file_progress_show_count (file_op_context_t * ctx, size_t done, size_t total); void file_progress_show_count (file_op_context_t * ctx);
void file_progress_show_total (file_op_context_t * ctx, uintmax_t copied_bytes, void file_progress_show_total (file_op_context_t * ctx, uintmax_t copied_bytes,
gboolean show_summary); gboolean show_summary);
void file_progress_show_source (file_op_context_t * ctx, const vfs_path_t * vpath); void file_progress_show_source (file_op_context_t * ctx, const vfs_path_t * vpath);