mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-27 05:29:27 +03:00
(panel_operate): minor optimization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
0747bc6fe5
commit
ad545f951a
@ -2390,8 +2390,6 @@ panel_operate (void *source_panel, FileOperation operation, gboolean force_singl
|
|||||||
}
|
}
|
||||||
|
|
||||||
ctx = file_op_context_new (operation);
|
ctx = file_op_context_new (operation);
|
||||||
tctx = file_op_total_context_new ();
|
|
||||||
gettimeofday (&(tctx->transfer_start), (struct timezone *) NULL);
|
|
||||||
|
|
||||||
/* Show confirmation dialog */
|
/* Show confirmation dialog */
|
||||||
if (operation != OP_DELETE)
|
if (operation != OP_DELETE)
|
||||||
@ -2422,11 +2420,11 @@ panel_operate (void *source_panel, FileOperation operation, gboolean force_singl
|
|||||||
/* just copy */
|
/* just copy */
|
||||||
dest_dir_ = g_strdup (dest_dir);
|
dest_dir_ = g_strdup (dest_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dest_dir_ == NULL)
|
if (dest_dir_ == NULL)
|
||||||
{
|
{
|
||||||
file_op_total_context_destroy (tctx);
|
ret_val = FALSE;
|
||||||
file_op_context_destroy (ctx);
|
goto ret_fast;
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generate confirmation prompt */
|
/* Generate confirmation prompt */
|
||||||
@ -2441,10 +2439,9 @@ panel_operate (void *source_panel, FileOperation operation, gboolean force_singl
|
|||||||
|
|
||||||
if (dest == NULL || dest[0] == '\0')
|
if (dest == NULL || dest[0] == '\0')
|
||||||
{
|
{
|
||||||
file_op_total_context_destroy (tctx);
|
|
||||||
file_op_context_destroy (ctx);
|
|
||||||
g_free (dest);
|
g_free (dest);
|
||||||
return FALSE;
|
ret_val = FALSE;
|
||||||
|
goto ret_fast;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (confirm_delete)
|
else if (confirm_delete)
|
||||||
@ -2473,12 +2470,14 @@ panel_operate (void *source_panel, FileOperation operation, gboolean force_singl
|
|||||||
|
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
{
|
{
|
||||||
file_op_total_context_destroy (tctx);
|
ret_val = FALSE;
|
||||||
file_op_context_destroy (ctx);
|
goto ret_fast;
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tctx = file_op_total_context_new ();
|
||||||
|
gettimeofday (&tctx->transfer_start, (struct timezone *) NULL);
|
||||||
|
|
||||||
{
|
{
|
||||||
filegui_dialog_type_t dialog_type;
|
filegui_dialog_type_t dialog_type;
|
||||||
|
|
||||||
@ -2766,8 +2765,9 @@ panel_operate (void *source_panel, FileOperation operation, gboolean force_singl
|
|||||||
}
|
}
|
||||||
#endif /* WITH_BACKGROUND */
|
#endif /* WITH_BACKGROUND */
|
||||||
|
|
||||||
file_op_context_destroy (ctx);
|
|
||||||
file_op_total_context_destroy (tctx);
|
file_op_total_context_destroy (tctx);
|
||||||
|
ret_fast:
|
||||||
|
file_op_context_destroy (ctx);
|
||||||
|
|
||||||
return ret_val;
|
return ret_val;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user