Merge branch '4563_reget_on_move'

* 4563_reget_on_move:
  Ticket #4563: support reget in file move operation.
This commit is contained in:
Andrew Borodin 2024-07-28 10:05:33 +03:00
commit dbca937c55
3 changed files with 8 additions and 4 deletions

View File

@ -2274,8 +2274,12 @@ copy_file_file (file_op_total_context_t *tctx, file_op_context_t *ctx,
vfs_path_t *src_vpath = NULL, *dst_vpath = NULL;
char *buf = NULL;
/* FIXME: We should not be using global variables! */
/* Keep the non-default value applied in chain of calls:
move_file_file() -> file_progress_real_query_replace()
move_file_file() -> copy_file_file() */
if (ctx->do_reget < 0)
ctx->do_reget = 0;
return_status = FILE_RETRY;
dst_vpath = vfs_path_from_str (dst_path);

View File

@ -569,7 +569,7 @@ overwrite_query_dialog (file_op_context_t *ctx, enum OperationMode mode)
/* will "Append" and "Reget" buttons be in the dialog? */
do_append = !S_ISDIR (ui->dst_stat->st_mode);
do_reget = do_append && ctx->operation == OP_COPY && ui->dst_stat->st_size != 0
do_reget = do_append && ui->dst_stat->st_size != 0
&& ui->src_stat->st_size > ui->dst_stat->st_size;
NEW_LABEL (8, dlg_widgets[8].text);

View File

@ -74,7 +74,7 @@ file_op_context_new (FileOperation op)
ctx->operation = op;
ctx->eta_secs = 0.0;
ctx->progress_bytes = 0;
ctx->do_reget = 1;
ctx->do_reget = -1;
ctx->stat_func = mc_lstat;
ctx->preserve = TRUE;
ctx->preserve_uidgid = (geteuid () == 0);