1
1

* screen.c (file_mark): Set dirty flag if the mark changes.

* cmd.c: Remove calls to paint_panel() due to file marks.
Этот коммит содержится в:
Pavel Roskin 2003-09-10 05:12:45 +00:00
родитель bab1cfdc49
Коммит 9f461b6697
3 изменённых файлов: 34 добавлений и 37 удалений

Просмотреть файл

@ -1,5 +1,8 @@
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
with the dirty flag.
(panel_update_contents): Make static, don't call directly.

Просмотреть файл

@ -474,7 +474,6 @@ void reverse_selection_cmd (void)
continue;
do_file_mark (cpanel, i, !file->f.marked);
}
paint_panel (cpanel);
}
void select_cmd (void)
@ -520,7 +519,6 @@ void select_cmd (void)
do_file_mark (cpanel, i, 1);
}
}
paint_panel (cpanel);
g_free (reg_exp);
}
@ -566,7 +564,6 @@ void unselect_cmd (void)
do_file_mark (cpanel, i, 0);
}
}
paint_panel (cpanel);
g_free (reg_exp);
}
@ -876,8 +873,6 @@ compare_dirs_cmd (void)
&& get_other_type () == view_listing) {
compare_dir (cpanel, opanel, thorough_flag);
compare_dir (opanel, cpanel, thorough_flag);
paint_panel (cpanel);
paint_panel (opanel);
} else {
message (1, MSG_ERROR,
_(" Both panels should be in the "

Просмотреть файл

@ -1827,45 +1827,41 @@ recalculate_panel_summary (WPanel *panel)
void
do_file_mark (WPanel *panel, int idx, int mark)
{
if (panel->dir.list [idx].f.marked == mark)
return;
/*
* Only '..' can't be marked, '.' isn't visible.
*/
if (strcmp (panel->dir.list [idx].fname, "..")){
file_mark (panel, idx, mark);
if (panel->dir.list [idx].f.marked){
panel->marked++;
if (S_ISDIR (panel->dir.list [idx].st.st_mode)) {
if (panel->dir.list [idx].f.dir_size_computed)
panel->total += panel->dir.list [idx].st.st_size;
panel->dirs_marked++;
} else
panel->total += panel->dir.list [idx].st.st_size;
set_colors (panel);
} else {
if (S_ISDIR(panel->dir.list [idx].st.st_mode)) {
if (panel->dir.list [idx].f.dir_size_computed)
panel->total -= panel->dir.list [idx].st.st_size;
panel->dirs_marked--;
} else
panel->total -= panel->dir.list [idx].st.st_size;
panel->marked--;
}
if (panel->dir.list[idx].f.marked == mark)
return;
/* Only '..' can't be marked, '.' isn't visible */
if (!strcmp (panel->dir.list[idx].fname, ".."))
return;
file_mark (panel, idx, mark);
if (panel->dir.list[idx].f.marked) {
panel->marked++;
if (S_ISDIR (panel->dir.list[idx].st.st_mode)) {
if (panel->dir.list[idx].f.dir_size_computed)
panel->total += panel->dir.list[idx].st.st_size;
panel->dirs_marked++;
} else
panel->total += panel->dir.list[idx].st.st_size;
set_colors (panel);
} else {
if (S_ISDIR (panel->dir.list[idx].st.st_mode)) {
if (panel->dir.list[idx].f.dir_size_computed)
panel->total -= panel->dir.list[idx].st.st_size;
panel->dirs_marked--;
} else
panel->total -= panel->dir.list[idx].st.st_size;
panel->marked--;
}
}
static void
do_mark_file (WPanel *panel, int do_move)
{
int idx = panel->selected;
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);
do_file_mark (panel, panel->selected,
selection (panel)->f.marked ? 0 : 1);
if (mark_moves_down && do_move)
move_down (panel);
display_mini_info (panel);
}
static void
@ -2240,7 +2236,10 @@ panel_callback (WPanel *panel, int msg, int par)
void
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;
}
}
/* */