(file_op_total_context_t): rename members.

bps -> total_bps
transfer_start -> total_transfer_start
eta_secs -> total_eta_secs

No functional changes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2024-08-17 12:45:35 +03:00
parent ab5bbba2dd
commit dde9002aaf
3 changed files with 16 additions and 16 deletions

View File

@ -1156,12 +1156,12 @@ copy_file_file_display_progress (file_op_total_context_t *tctx, file_op_context_
{ {
gint64 total_secs; gint64 total_secs;
total_secs = (tv_current - tctx->transfer_start) / G_USEC_PER_SEC; total_secs = (tv_current - tctx->total_transfer_start) / G_USEC_PER_SEC;
total_secs = MAX (1, total_secs); total_secs = MAX (1, total_secs);
tctx->bps = tctx->copied_bytes / total_secs; tctx->total_bps = tctx->copied_bytes / total_secs;
const uintmax_t remain_bytes = ctx->total_bytes - tctx->copied_bytes; const uintmax_t remain_bytes = ctx->total_bytes - tctx->copied_bytes;
tctx->eta_secs = tctx->bps != 0 ? remain_bytes / tctx->bps : 0; tctx->total_eta_secs = tctx->total_bps != 0 ? remain_bytes / tctx->total_bps : 0;
} }
} }
@ -2653,7 +2653,7 @@ copy_file_file (file_op_total_context_t *tctx, file_op_context_t *ctx,
if (verbose) if (verbose)
{ {
if (tctx->bps == 0 || (file_size / tctx->bps) > FILEOP_UPDATE_INTERVAL) if (tctx->total_bps == 0 || (file_size / tctx->total_bps) > FILEOP_UPDATE_INTERVAL)
file_progress_show (ctx, 0, file_size, "", TRUE); file_progress_show (ctx, 0, file_size, "", TRUE);
else else
file_progress_show (ctx, 1, 1, "", TRUE); file_progress_show (ctx, 1, 1, "", TRUE);
@ -2762,7 +2762,7 @@ copy_file_file (file_op_total_context_t *tctx, file_op_context_t *ctx,
if (update_usecs > FILEOP_STALLING_INTERVAL_US) if (update_usecs > FILEOP_STALLING_INTERVAL_US)
stalled_msg = _("(stalled)"); stalled_msg = _("(stalled)");
force_update = (tv_current - tctx->transfer_start) > FILEOP_UPDATE_INTERVAL_US; force_update = (tv_current - tctx->total_transfer_start) > FILEOP_UPDATE_INTERVAL_US;
if (verbose) if (verbose)
{ {
@ -3509,7 +3509,7 @@ panel_operate (void *source_panel, FileOperation operation, gboolean force_singl
} }
tctx = file_op_total_context_new (); tctx = file_op_total_context_new ();
tctx->transfer_start = g_get_monotonic_time (); tctx->total_transfer_start = g_get_monotonic_time ();
#ifdef ENABLE_BACKGROUND #ifdef ENABLE_BACKGROUND
/* Did the user select to do a background operation? */ /* Did the user select to do a background operation? */

View File

@ -1076,7 +1076,7 @@ file_progress_show_total (file_op_total_context_t *tctx, file_op_context_t *ctx,
} }
} }
if (!show_summary && tctx->bps == 0) if (!show_summary && tctx->total_bps == 0)
return; return;
if (ui->time_label != NULL) if (ui->time_label != NULL)
@ -1085,26 +1085,26 @@ file_progress_show_total (file_op_total_context_t *tctx, file_op_context_t *ctx,
char buffer4[BUF_TINY]; char buffer4[BUF_TINY];
tv_current = g_get_monotonic_time (); tv_current = g_get_monotonic_time ();
file_frmt_time (buffer2, (tv_current - tctx->transfer_start) / G_USEC_PER_SEC); file_frmt_time (buffer2, (tv_current - tctx->total_transfer_start) / G_USEC_PER_SEC);
if (ctx->totals_computed) if (ctx->totals_computed)
{ {
file_eta_prepare_for_show (buffer3, tctx->eta_secs, TRUE); file_eta_prepare_for_show (buffer3, tctx->total_eta_secs, TRUE);
if (tctx->bps == 0) if (tctx->total_bps == 0)
label_set_textv (ui->time_label, _("Time: %s %s"), buffer2, buffer3); label_set_textv (ui->time_label, _("Time: %s %s"), buffer2, buffer3);
else else
{ {
file_bps_prepare_for_show (buffer4, (long) tctx->bps); file_bps_prepare_for_show (buffer4, (long) tctx->total_bps);
label_set_textv (ui->time_label, _("Time: %s %s (%s)"), buffer2, buffer3, buffer4); label_set_textv (ui->time_label, _("Time: %s %s (%s)"), buffer2, buffer3, buffer4);
} }
} }
else else
{ {
if (tctx->bps == 0) if (tctx->total_bps == 0)
label_set_textv (ui->time_label, _("Time: %s"), buffer2); label_set_textv (ui->time_label, _("Time: %s"), buffer2);
else else
{ {
file_bps_prepare_for_show (buffer4, (long) tctx->bps); file_bps_prepare_for_show (buffer4, (long) tctx->total_bps);
label_set_textv (ui->time_label, _("Time: %s (%s)"), buffer2, buffer4); label_set_textv (ui->time_label, _("Time: %s (%s)"), buffer2, buffer4);
} }
} }

View File

@ -165,9 +165,9 @@ typedef struct
size_t prev_progress_count; /* Used in OP_MOVE between copy and remove directories */ size_t prev_progress_count; /* Used in OP_MOVE between copy and remove directories */
uintmax_t progress_bytes; uintmax_t progress_bytes;
uintmax_t copied_bytes; uintmax_t copied_bytes;
size_t bps; size_t total_bps;
gint64 transfer_start; gint64 total_transfer_start;
double eta_secs; double total_eta_secs;
gboolean ask_overwrite; gboolean ask_overwrite;
} file_op_total_context_t; } file_op_total_context_t;