* tree.c (tree_rmdir_cmd): Don't change to the root directory -
it's not needed now.
Этот коммит содержится в:
родитель
2bf7ae1b6c
Коммит
1ddf30732b
@ -1,5 +1,8 @@
|
||||
2003-10-27 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* tree.c (tree_rmdir_cmd): Don't change to the root directory -
|
||||
it's not needed now.
|
||||
|
||||
* win.c (check_movement_keys): Add support for Ctrl-PgDown,
|
||||
Ctrl-PgUp, Ctrl-Home and Ctrl-End.
|
||||
|
||||
|
48
src/tree.c
48
src/tree.c
@ -690,37 +690,33 @@ tree_mkdir_cmd (WTree *tree)
|
||||
static void
|
||||
tree_rmdir_cmd (WTree *tree)
|
||||
{
|
||||
char old_dir [MC_MAXPATHLEN];
|
||||
off_t count = 0;
|
||||
double bytes = 0;
|
||||
FileOpContext *ctx;
|
||||
|
||||
if (tree->selected_ptr){
|
||||
if (!mc_get_current_wd (old_dir, MC_MAXPATHLEN))
|
||||
return;
|
||||
if (mc_chdir (PATH_SEP_STR))
|
||||
return;
|
||||
if (confirm_delete){
|
||||
char *buf;
|
||||
int result;
|
||||
|
||||
buf = g_strdup_printf (_(" Delete %s? "), tree->selected_ptr->name);
|
||||
result = query_dialog (_(" Delete "), buf, 3, 2, _("&Yes"), _("&No"));
|
||||
g_free (buf);
|
||||
if (result != 0){
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ctx = file_op_context_new ();
|
||||
file_op_context_create_ui (ctx, OP_DELETE, FALSE);
|
||||
if (erase_dir (ctx, tree->selected_ptr->name, &count, &bytes) == FILE_CONT)
|
||||
tree_forget_cmd (tree);
|
||||
file_op_context_destroy (ctx);
|
||||
mc_chdir (old_dir);
|
||||
return;
|
||||
} else
|
||||
if (!tree->selected_ptr)
|
||||
return;
|
||||
|
||||
if (confirm_delete) {
|
||||
char *buf;
|
||||
int result;
|
||||
|
||||
buf =
|
||||
g_strdup_printf (_(" Delete %s? "),
|
||||
tree->selected_ptr->name);
|
||||
result =
|
||||
query_dialog (_(" Delete "), buf, 3, 2, _("&Yes"), _("&No"));
|
||||
g_free (buf);
|
||||
if (result != 0)
|
||||
return;
|
||||
}
|
||||
|
||||
ctx = file_op_context_new ();
|
||||
file_op_context_create_ui (ctx, OP_DELETE, FALSE);
|
||||
if (erase_dir (ctx, tree->selected_ptr->name, &count, &bytes) ==
|
||||
FILE_CONT)
|
||||
tree_forget_cmd (tree);
|
||||
file_op_context_destroy (ctx);
|
||||
}
|
||||
|
||||
static void set_navig_label (WTree *tree);
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user