mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
Merge branch '4027_single_move_compute_total'
* 4027_single_move_compute_total: Ticket #4027: (do_move_dir_dir): totals aren't computed before move of a single directory.
This commit is contained in:
commit
e022f5f4e5
@ -1564,6 +1564,7 @@ do_move_dir_dir (const WPanel * panel, file_op_total_context_t * tctx, file_op_c
|
|||||||
gboolean move_over = FALSE;
|
gboolean move_over = FALSE;
|
||||||
gboolean dstat_ok;
|
gboolean dstat_ok;
|
||||||
vfs_path_t *src_vpath, *dst_vpath;
|
vfs_path_t *src_vpath, *dst_vpath;
|
||||||
|
gboolean calc_total = FALSE;
|
||||||
|
|
||||||
src_vpath = vfs_path_from_str (s);
|
src_vpath = vfs_path_from_str (s);
|
||||||
dst_vpath = vfs_path_from_str (d);
|
dst_vpath = vfs_path_from_str (d);
|
||||||
@ -1608,6 +1609,19 @@ do_move_dir_dir (const WPanel * panel, file_op_total_context_t * tctx, file_op_c
|
|||||||
{
|
{
|
||||||
if (move_over)
|
if (move_over)
|
||||||
{
|
{
|
||||||
|
if (panel != NULL)
|
||||||
|
{
|
||||||
|
/* In case of single directory, calculate totals. In case of many directories,
|
||||||
|
totals are calcuated already. */
|
||||||
|
return_status =
|
||||||
|
panel_operate_init_totals (panel, src_vpath, &src_stat, ctx, TRUE,
|
||||||
|
FILEGUI_DIALOG_MULTI_ITEM);
|
||||||
|
if (return_status != FILE_CONT)
|
||||||
|
goto ret;
|
||||||
|
|
||||||
|
calc_total = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
return_status = copy_dir_dir (tctx, ctx, s, d, FALSE, TRUE, TRUE, NULL);
|
return_status = copy_dir_dir (tctx, ctx, s, d, FALSE, TRUE, TRUE, NULL);
|
||||||
|
|
||||||
if (return_status != FILE_CONT)
|
if (return_status != FILE_CONT)
|
||||||
@ -1652,13 +1666,13 @@ do_move_dir_dir (const WPanel * panel, file_op_total_context_t * tctx, file_op_c
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Failed because of filesystem boundary -> copy dir instead */
|
/* Failed because of filesystem boundary -> copy dir instead */
|
||||||
if (panel != NULL)
|
if (panel != NULL && !calc_total)
|
||||||
{
|
{
|
||||||
/* In case of single directory, calculate totals. In case of many directories,
|
/* In case of single directory, calculate totals. In case of many directories,
|
||||||
totals are calcuated already. */
|
totals are calcuated already. */
|
||||||
return_status =
|
return_status =
|
||||||
panel_operate_init_totals (panel, src_vpath, &src_stat, ctx, FALSE,
|
panel_operate_init_totals (panel, src_vpath, &src_stat, ctx, TRUE,
|
||||||
FILEGUI_DIALOG_ONE_ITEM);
|
FILEGUI_DIALOG_MULTI_ITEM);
|
||||||
if (return_status != FILE_CONT)
|
if (return_status != FILE_CONT)
|
||||||
goto ret;
|
goto ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user