* cmd.c: Added single_dirsize_cmd(), which computes the size of
the currently selected panel entry and moves down. Suggested by ForestCreature on mc-devel. * cmd.h: Likewise. * main.c (midnight_callback): When the space key is pressed and the command line is empty, single_dirsize_cmd() is called.
Этот коммит содержится в:
родитель
e0898803a1
Коммит
0e218318da
@ -1,3 +1,12 @@
|
|||||||
|
2005-09-06 Roland Illig <roland.illig@gmx.de>
|
||||||
|
|
||||||
|
* cmd.c: Added single_dirsize_cmd(), which computes the size of
|
||||||
|
the currently selected panel entry and moves down. Suggested by
|
||||||
|
ForestCreature on mc-devel.
|
||||||
|
* cmd.h: Likewise.
|
||||||
|
* main.c (midnight_callback): When the space key is pressed and
|
||||||
|
the command line is empty, single_dirsize_cmd() is called.
|
||||||
|
|
||||||
2005-09-05 Roland Illig <roland.illig@gmx.de>
|
2005-09-05 Roland Illig <roland.illig@gmx.de>
|
||||||
|
|
||||||
* info.c: Switched from printw() to tty_printf() to avoid gcc
|
* info.c: Switched from printw() to tty_printf() to avoid gcc
|
||||||
|
23
src/cmd.c
23
src/cmd.c
@ -1173,6 +1173,29 @@ void quick_cd_cmd (void)
|
|||||||
g_free (p);
|
g_free (p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
single_dirsize_cmd (void)
|
||||||
|
{
|
||||||
|
WPanel *panel = current_panel;
|
||||||
|
file_entry *entry;
|
||||||
|
off_t marked;
|
||||||
|
double total;
|
||||||
|
|
||||||
|
entry = &(panel->dir.list[panel->selected]);
|
||||||
|
if (S_ISDIR (entry->st.st_mode) && strcmp(entry->fname, "..") != 0) {
|
||||||
|
total = 0.0;
|
||||||
|
compute_dir_size (entry->fname, &marked, &total);
|
||||||
|
entry->st.st_size = (off_t) total;
|
||||||
|
entry->f.dir_size_computed = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mark_moves_down)
|
||||||
|
send_message (&(panel->widget), WIDGET_KEY, KEY_DOWN);
|
||||||
|
|
||||||
|
recalculate_panel_summary (panel);
|
||||||
|
panel->dirty = 1;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
dirsizes_cmd (void)
|
dirsizes_cmd (void)
|
||||||
{
|
{
|
||||||
|
@ -7,6 +7,7 @@ void fishlink_cmd (void);
|
|||||||
void smblink_cmd (void);
|
void smblink_cmd (void);
|
||||||
void undelete_cmd (void);
|
void undelete_cmd (void);
|
||||||
void help_cmd (void);
|
void help_cmd (void);
|
||||||
|
void single_dirsize_cmd (void);
|
||||||
void dirsizes_cmd (void);
|
void dirsizes_cmd (void);
|
||||||
int view_file_at_line (const char *filename, int plain_view, int internal,
|
int view_file_at_line (const char *filename, int plain_view, int internal,
|
||||||
int start_line);
|
int start_line);
|
||||||
|
@ -1543,6 +1543,11 @@ midnight_callback (struct Dlg_head *h, dlg_msg_t msg, int parm)
|
|||||||
reverse_selection_cmd ();
|
reverse_selection_cmd ();
|
||||||
return MSG_HANDLED;
|
return MSG_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (parm == ' ') {
|
||||||
|
single_dirsize_cmd ();
|
||||||
|
return MSG_HANDLED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return MSG_NOT_HANDLED;
|
return MSG_NOT_HANDLED;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user