From 334560adacf59e46df53c7edf2c1ea82172e9c79 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 14 Feb 2010 20:09:36 +0300 Subject: [PATCH] Show Count progress bar before copy/move of 1st file,Z not after. Signed-off-by: Andrew Borodin --- src/file.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/file.c b/src/file.c index 8b1c8a657..24f762efc 100644 --- a/src/file.c +++ b/src/file.c @@ -359,14 +359,11 @@ progress_update_one (FileOpContext *ctx, } /* Apply some heuristic here to not call the update stuff very often */ - ret = - file_progress_show_count (ctx, *progress_count, - ctx->progress_count); - if (ret != FILE_CONT) - return ret; - ret = - file_progress_show_bytes (ctx, *progress_bytes, - ctx->progress_bytes); + ret = file_progress_show_count (ctx, *progress_count, + ctx->progress_count); + if (ret == FILE_CONT) + ret = file_progress_show_bytes (ctx, *progress_bytes, + ctx->progress_bytes); return ret; } @@ -705,12 +702,19 @@ copy_file_file (FileOpContext *ctx, const char *src_path, const char *dst_path, } file_progress_set_stalled_label (ctx, stalled_msg); - return_status = file_progress_show_bytes (ctx, *progress_bytes + - n_read_total + ctx->do_reget, ctx->progress_bytes); - if (return_status == FILE_CONT) { + + return_status = + file_progress_show_count (ctx, *progress_count, + ctx->progress_count); + if (return_status == FILE_CONT) + return_status = + file_progress_show_bytes (ctx, *progress_bytes + + n_read_total + ctx->do_reget, + ctx->progress_bytes); + if (return_status == FILE_CONT) return_status = file_progress_show (ctx, n_read_total + ctx->do_reget, file_size); - } + mc_refresh (); if (return_status != FILE_CONT) goto ret;