* screen.c (file_mark): Set dirty flag if the mark changes.
* cmd.c: Remove calls to paint_panel() due to file marks.
Этот коммит содержится в:
родитель
bab1cfdc49
Коммит
9f461b6697
@ -1,5 +1,8 @@
|
|||||||
2003-09-10 Pavel Roskin <proski@gnu.org>
|
2003-09-10 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* screen.c (file_mark): Set dirty flag if the mark changes.
|
||||||
|
* cmd.c: Remove calls to paint_panel() due to file marks.
|
||||||
|
|
||||||
* screen.c (update_dirty_panels): New function - update panels
|
* screen.c (update_dirty_panels): New function - update panels
|
||||||
with the dirty flag.
|
with the dirty flag.
|
||||||
(panel_update_contents): Make static, don't call directly.
|
(panel_update_contents): Make static, don't call directly.
|
||||||
|
@ -474,7 +474,6 @@ void reverse_selection_cmd (void)
|
|||||||
continue;
|
continue;
|
||||||
do_file_mark (cpanel, i, !file->f.marked);
|
do_file_mark (cpanel, i, !file->f.marked);
|
||||||
}
|
}
|
||||||
paint_panel (cpanel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void select_cmd (void)
|
void select_cmd (void)
|
||||||
@ -520,7 +519,6 @@ void select_cmd (void)
|
|||||||
do_file_mark (cpanel, i, 1);
|
do_file_mark (cpanel, i, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
paint_panel (cpanel);
|
|
||||||
g_free (reg_exp);
|
g_free (reg_exp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -566,7 +564,6 @@ void unselect_cmd (void)
|
|||||||
do_file_mark (cpanel, i, 0);
|
do_file_mark (cpanel, i, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
paint_panel (cpanel);
|
|
||||||
g_free (reg_exp);
|
g_free (reg_exp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -876,8 +873,6 @@ compare_dirs_cmd (void)
|
|||||||
&& get_other_type () == view_listing) {
|
&& get_other_type () == view_listing) {
|
||||||
compare_dir (cpanel, opanel, thorough_flag);
|
compare_dir (cpanel, opanel, thorough_flag);
|
||||||
compare_dir (opanel, cpanel, thorough_flag);
|
compare_dir (opanel, cpanel, thorough_flag);
|
||||||
paint_panel (cpanel);
|
|
||||||
paint_panel (opanel);
|
|
||||||
} else {
|
} else {
|
||||||
message (1, MSG_ERROR,
|
message (1, MSG_ERROR,
|
||||||
_(" Both panels should be in the "
|
_(" Both panels should be in the "
|
||||||
|
63
src/screen.c
63
src/screen.c
@ -1827,45 +1827,41 @@ recalculate_panel_summary (WPanel *panel)
|
|||||||
void
|
void
|
||||||
do_file_mark (WPanel *panel, int idx, int mark)
|
do_file_mark (WPanel *panel, int idx, int mark)
|
||||||
{
|
{
|
||||||
if (panel->dir.list [idx].f.marked == mark)
|
if (panel->dir.list[idx].f.marked == mark)
|
||||||
return;
|
return;
|
||||||
/*
|
|
||||||
* Only '..' can't be marked, '.' isn't visible.
|
/* Only '..' can't be marked, '.' isn't visible */
|
||||||
*/
|
if (!strcmp (panel->dir.list[idx].fname, ".."))
|
||||||
if (strcmp (panel->dir.list [idx].fname, "..")){
|
return;
|
||||||
file_mark (panel, idx, mark);
|
|
||||||
if (panel->dir.list [idx].f.marked){
|
file_mark (panel, idx, mark);
|
||||||
panel->marked++;
|
if (panel->dir.list[idx].f.marked) {
|
||||||
if (S_ISDIR (panel->dir.list [idx].st.st_mode)) {
|
panel->marked++;
|
||||||
if (panel->dir.list [idx].f.dir_size_computed)
|
if (S_ISDIR (panel->dir.list[idx].st.st_mode)) {
|
||||||
panel->total += panel->dir.list [idx].st.st_size;
|
if (panel->dir.list[idx].f.dir_size_computed)
|
||||||
panel->dirs_marked++;
|
panel->total += panel->dir.list[idx].st.st_size;
|
||||||
} else
|
panel->dirs_marked++;
|
||||||
panel->total += panel->dir.list [idx].st.st_size;
|
} else
|
||||||
set_colors (panel);
|
panel->total += panel->dir.list[idx].st.st_size;
|
||||||
} else {
|
set_colors (panel);
|
||||||
if (S_ISDIR(panel->dir.list [idx].st.st_mode)) {
|
} else {
|
||||||
if (panel->dir.list [idx].f.dir_size_computed)
|
if (S_ISDIR (panel->dir.list[idx].st.st_mode)) {
|
||||||
panel->total -= panel->dir.list [idx].st.st_size;
|
if (panel->dir.list[idx].f.dir_size_computed)
|
||||||
panel->dirs_marked--;
|
panel->total -= panel->dir.list[idx].st.st_size;
|
||||||
} else
|
panel->dirs_marked--;
|
||||||
panel->total -= panel->dir.list [idx].st.st_size;
|
} else
|
||||||
panel->marked--;
|
panel->total -= panel->dir.list[idx].st.st_size;
|
||||||
}
|
panel->marked--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
do_mark_file (WPanel *panel, int do_move)
|
do_mark_file (WPanel *panel, int do_move)
|
||||||
{
|
{
|
||||||
int idx = panel->selected;
|
do_file_mark (panel, panel->selected,
|
||||||
|
selection (panel)->f.marked ? 0 : 1);
|
||||||
do_file_mark (panel, idx, selection (panel)->f.marked ? 0 : 1);
|
|
||||||
repaint_file (panel, idx, 1, 2*panel->dir.list [idx].f.marked+1, 0);
|
|
||||||
|
|
||||||
if (mark_moves_down && do_move)
|
if (mark_moves_down && do_move)
|
||||||
move_down (panel);
|
move_down (panel);
|
||||||
display_mini_info (panel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -2240,7 +2236,10 @@ panel_callback (WPanel *panel, int msg, int par)
|
|||||||
void
|
void
|
||||||
file_mark (WPanel *panel, int index, int val)
|
file_mark (WPanel *panel, int index, int val)
|
||||||
{
|
{
|
||||||
panel->dir.list [index].f.marked = val;
|
if (panel->dir.list[index].f.marked != val) {
|
||||||
|
panel->dir.list[index].f.marked = val;
|
||||||
|
panel->dirty = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user