From 40b17d420ceb6e07cb2e22e60238929ab472d6e1 Mon Sep 17 00:00:00 2001
From: Mooffie <mooffie@gmail.com>
Date: Thu, 14 Jul 2016 22:47:10 +0300
Subject: [PATCH] Ticket #3663: panelize resets marks on marked files.
---
src/filemanager/panel.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/filemanager/panel.c b/src/filemanager/panel.c
index 28cf315..eaf73c9 100644
a
|
b
|
reload_panelized (WPanel * panel) |
4054 | 4054 | (void) mc_chdir (panel->cwd_vpath); |
4055 | 4055 | |
4056 | 4056 | for (i = 0, j = 0; i < list->len; i++) |
4057 | 4057 | { |
4058 | 4058 | vfs_path_t *vpath; |
| 4059 | gboolean marked; |
4059 | 4060 | |
4060 | | if (list->list[i].f.marked) |
| 4061 | marked = list->list[i].f.marked; |
| 4062 | |
| 4063 | if (marked) |
4061 | 4064 | { |
4062 | 4065 | /* Unmark the file in advance. In case the following mc_lstat |
4063 | 4066 | * fails we are done, else we have to mark the file again |
4064 | | * (Note: do_file_mark depends on a valid "list->list [i].buf"). |
| 4067 | * (Note: do_file_mark depends on a valid "list->list [i].st"). |
4065 | 4068 | * IMO that's the best way to update the panel's summary status |
4066 | 4069 | * -- Norbert |
4067 | 4070 | */ |
4068 | 4071 | do_file_mark (panel, i, 0); |
4069 | 4072 | } |
4070 | 4073 | vpath = vfs_path_from_str (list->list[i].fname); |
4071 | 4074 | if (mc_lstat (vpath, &list->list[i].st) != 0) |
4072 | 4075 | g_free (list->list[i].fname); |
4073 | 4076 | else |
4074 | 4077 | { |
4075 | | if (list->list[i].f.marked) |
| 4078 | if (marked) |
4076 | 4079 | do_file_mark (panel, i, 1); |
4077 | 4080 | if (j != i) |
4078 | 4081 | list->list[j] = list->list[i]; |
4079 | 4082 | j++; |
4080 | 4083 | } |