mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
Merge branch '2447_prepare_to_4.7.5'
* 2447_prepare_to_4.7.5: (fish_fill_names): remove unexpected break. (panel_save_curent_file_to_clip_file): 'res' might be used uninitialized here. Fixed English and Russian man pages. (warn_same_file): cleanup of preprocessing usage. fix VFS crashes. Panel update: type accuracy. Replaced remaining grep with @GREP@ in iso9660 VFS plugin. (single_dirsize_cmd): send CK_PanelMoveDown message instead of KEY_DOWN one to panel. Ticket #2447: code cleanup before 4.7.5 release.
This commit is contained in:
commit
09533cf671
@ -3973,6 +3973,7 @@ For example:
|
|||||||
.PP
|
.PP
|
||||||
.nf
|
.nf
|
||||||
clipboard_store=xclip \-i
|
clipboard_store=xclip \-i
|
||||||
|
.fi
|
||||||
.TP
|
.TP
|
||||||
.I clipboard_paste
|
.I clipboard_paste
|
||||||
This variable contains path (with options) to the external clipboard
|
This variable contains path (with options) to the external clipboard
|
||||||
@ -3980,7 +3981,8 @@ utility like 'xclip' to print the selection to standard out.
|
|||||||
For example:
|
For example:
|
||||||
.PP
|
.PP
|
||||||
.nf
|
.nf
|
||||||
clipboard_store=xclip \-o
|
clipboard_pastee=xclip \-o
|
||||||
|
.fi
|
||||||
.TP
|
.TP
|
||||||
.I autodetect_codeset
|
.I autodetect_codeset
|
||||||
This option allows use the `enca' command to autodetect codeset of text files
|
This option allows use the `enca' command to autodetect codeset of text files
|
||||||
|
@ -4257,6 +4257,7 @@ mc.ext\&.
|
|||||||
.PP
|
.PP
|
||||||
.nf
|
.nf
|
||||||
clipboard_store=xclip \-i
|
clipboard_store=xclip \-i
|
||||||
|
.fi
|
||||||
.TP
|
.TP
|
||||||
.I clipboard_paste
|
.I clipboard_paste
|
||||||
Эта переменная позволяет назначить внешнюю программу (с параметрами) для
|
Эта переменная позволяет назначить внешнюю программу (с параметрами) для
|
||||||
@ -4265,7 +4266,8 @@ clipboard_store=xclip \-i
|
|||||||
Например:
|
Например:
|
||||||
.PP
|
.PP
|
||||||
.nf
|
.nf
|
||||||
clipboard_store=xclip \-o
|
clipboard_paste=xclip \-o
|
||||||
|
.fi
|
||||||
.PP
|
.PP
|
||||||
.I autodetect_codeset
|
.I autodetect_codeset
|
||||||
.IP
|
.IP
|
||||||
|
@ -1166,8 +1166,12 @@ vfs_s_open (struct vfs_class *me, const char *file, int flags, mode_t mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
split_dir_name (me, q, &dirname, &name, &save);
|
split_dir_name (me, q, &dirname, &name, &save);
|
||||||
/* FIXME: check if vfs_s_find_inode returns NULL */
|
|
||||||
dir = vfs_s_find_inode (me, super, dirname, LINK_FOLLOW, FL_DIR);
|
dir = vfs_s_find_inode (me, super, dirname, LINK_FOLLOW, FL_DIR);
|
||||||
|
if (dir == NULL)
|
||||||
|
{
|
||||||
|
g_free (q);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
if (save)
|
if (save)
|
||||||
*save = PATH_SEP;
|
*save = PATH_SEP;
|
||||||
ent = vfs_s_generate_entry (me, name, dir, 0755);
|
ent = vfs_s_generate_entry (me, name, dir, 0755);
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
test_iso () {
|
test_iso () {
|
||||||
CHARSET=`locale charmap 2>/dev/null`
|
CHARSET=`locale charmap 2>/dev/null`
|
||||||
if test -z "$CHARSET"; then
|
if test -z "$CHARSET"; then
|
||||||
CHARSET=`locale 2>/dev/null | grep LC_CTYPE | sed -n -e 's/.*\.\(.*\)"$/\1/p'`
|
CHARSET=`locale 2>/dev/null | @GREP@ LC_CTYPE | sed -n -e 's/.*\.\(.*\)"$/\1/p'`
|
||||||
fi
|
fi
|
||||||
if test -n "$CHARSET"; then
|
if test -n "$CHARSET"; then
|
||||||
CHARSET=`echo "$CHARSET" | tr '[A-Z]' '[a-z]' | sed -e 's/^iso-/iso/'`
|
CHARSET=`echo "$CHARSET" | tr '[A-Z]' '[a-z]' | sed -e 's/^iso-/iso/'`
|
||||||
|
@ -128,7 +128,7 @@ int fish_directory_timeout = 900;
|
|||||||
return -1; \
|
return -1; \
|
||||||
} \
|
} \
|
||||||
rpath = strutils_shell_escape (crpath); \
|
rpath = strutils_shell_escape (crpath); \
|
||||||
g_free (mpath);
|
g_free (mpath)
|
||||||
|
|
||||||
/*** file scope type declarations ****************************************************************/
|
/*** file scope type declarations ****************************************************************/
|
||||||
|
|
||||||
@ -1221,7 +1221,9 @@ static int
|
|||||||
fish_chmod (struct vfs_class *me, const char *path, int mode)
|
fish_chmod (struct vfs_class *me, const char *path, int mode)
|
||||||
{
|
{
|
||||||
gchar *shell_commands = NULL;
|
gchar *shell_commands = NULL;
|
||||||
PREFIX
|
|
||||||
|
PREFIX;
|
||||||
|
|
||||||
shell_commands = g_strconcat (SUP.scr_env, "FISH_FILENAME=%s FISH_FILEMODE=%4.4o;\n",
|
shell_commands = g_strconcat (SUP.scr_env, "FISH_FILENAME=%s FISH_FILEMODE=%4.4o;\n",
|
||||||
SUP.scr_chmod, (char *) NULL);
|
SUP.scr_chmod, (char *) NULL);
|
||||||
g_snprintf (buf, sizeof (buf), shell_commands, rpath, mode & 07777);
|
g_snprintf (buf, sizeof (buf), shell_commands, rpath, mode & 07777);
|
||||||
@ -1252,7 +1254,8 @@ fish_chown (struct vfs_class *me, const char *path, uid_t owner, gid_t group)
|
|||||||
{
|
{
|
||||||
gchar *shell_commands = NULL;
|
gchar *shell_commands = NULL;
|
||||||
|
|
||||||
PREFIX
|
PREFIX;
|
||||||
|
|
||||||
shell_commands = g_strconcat (SUP.scr_env,
|
shell_commands = g_strconcat (SUP.scr_env,
|
||||||
"FISH_FILENAME=%s FISH_FILEOWNER=%s FISH_FILEGROUP=%s;\n",
|
"FISH_FILENAME=%s FISH_FILEOWNER=%s FISH_FILEGROUP=%s;\n",
|
||||||
SUP.scr_chown, (char *) NULL);
|
SUP.scr_chown, (char *) NULL);
|
||||||
@ -1272,7 +1275,9 @@ static int
|
|||||||
fish_unlink (struct vfs_class *me, const char *path)
|
fish_unlink (struct vfs_class *me, const char *path)
|
||||||
{
|
{
|
||||||
gchar *shell_commands = NULL;
|
gchar *shell_commands = NULL;
|
||||||
PREFIX
|
|
||||||
|
PREFIX;
|
||||||
|
|
||||||
shell_commands =
|
shell_commands =
|
||||||
g_strconcat (SUP.scr_env, "FISH_FILENAME=%s;\n", SUP.scr_unlink, (char *) NULL);
|
g_strconcat (SUP.scr_env, "FISH_FILENAME=%s;\n", SUP.scr_unlink, (char *) NULL);
|
||||||
g_snprintf (buf, sizeof (buf), shell_commands, rpath);
|
g_snprintf (buf, sizeof (buf), shell_commands, rpath);
|
||||||
@ -1287,7 +1292,9 @@ static int
|
|||||||
fish_exists (struct vfs_class *me, const char *path)
|
fish_exists (struct vfs_class *me, const char *path)
|
||||||
{
|
{
|
||||||
gchar *shell_commands = NULL;
|
gchar *shell_commands = NULL;
|
||||||
PREFIX
|
|
||||||
|
PREFIX;
|
||||||
|
|
||||||
shell_commands =
|
shell_commands =
|
||||||
g_strconcat (SUP.scr_env, "FISH_FILENAME=%s;\n", SUP.scr_exists, (char *) NULL);
|
g_strconcat (SUP.scr_env, "FISH_FILENAME=%s;\n", SUP.scr_exists, (char *) NULL);
|
||||||
g_snprintf (buf, sizeof (buf), shell_commands, rpath);
|
g_snprintf (buf, sizeof (buf), shell_commands, rpath);
|
||||||
@ -1306,7 +1313,9 @@ fish_mkdir (struct vfs_class *me, const char *path, mode_t mode)
|
|||||||
gchar *shell_commands = NULL;
|
gchar *shell_commands = NULL;
|
||||||
int ret_code;
|
int ret_code;
|
||||||
|
|
||||||
PREFIX (void) mode;
|
PREFIX;
|
||||||
|
|
||||||
|
(void) mode;
|
||||||
|
|
||||||
shell_commands = g_strconcat (SUP.scr_env, "FISH_FILENAME=%s;\n", SUP.scr_mkdir, (char *) NULL);
|
shell_commands = g_strconcat (SUP.scr_env, "FISH_FILENAME=%s;\n", SUP.scr_mkdir, (char *) NULL);
|
||||||
g_snprintf (buf, sizeof (buf), shell_commands, rpath);
|
g_snprintf (buf, sizeof (buf), shell_commands, rpath);
|
||||||
@ -1331,9 +1340,10 @@ static int
|
|||||||
fish_rmdir (struct vfs_class *me, const char *path)
|
fish_rmdir (struct vfs_class *me, const char *path)
|
||||||
{
|
{
|
||||||
gchar *shell_commands = NULL;
|
gchar *shell_commands = NULL;
|
||||||
PREFIX
|
|
||||||
shell_commands =
|
PREFIX;
|
||||||
g_strconcat (SUP.scr_env, "FISH_FILENAME=%s;\n", SUP.scr_rmdir, (char *) NULL);
|
|
||||||
|
shell_commands = g_strconcat (SUP.scr_env, "FISH_FILENAME=%s;\n", SUP.scr_rmdir, (char *) NULL);
|
||||||
g_snprintf (buf, sizeof (buf), shell_commands, rpath);
|
g_snprintf (buf, sizeof (buf), shell_commands, rpath);
|
||||||
g_free (shell_commands);
|
g_free (shell_commands);
|
||||||
g_free (rpath);
|
g_free (rpath);
|
||||||
@ -1394,7 +1404,6 @@ fish_fill_names (struct vfs_class *me, fill_names_f func)
|
|||||||
default:
|
default:
|
||||||
if (SUP.flags > FISH_FLAG_RSH)
|
if (SUP.flags > FISH_FLAG_RSH)
|
||||||
{
|
{
|
||||||
break;
|
|
||||||
g_snprintf (gbuf, sizeof (gbuf), ":%d", SUP.flags);
|
g_snprintf (gbuf, sizeof (gbuf), ":%d", SUP.flags);
|
||||||
flags = gbuf;
|
flags = gbuf;
|
||||||
}
|
}
|
||||||
|
@ -222,7 +222,7 @@ vfs_stamp_create (struct vfs_class *oldvfs, vfsid oldvfsid)
|
|||||||
n3vfsid = NULL;
|
n3vfsid = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!oldvfs->nothingisopen || !(*oldvfs->nothingisopen) (oldvfsid))
|
if (!oldvfs || !oldvfs->nothingisopen || !(*oldvfs->nothingisopen) (oldvfsid))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
vfs_addstamp (oldvfs, oldvfsid);
|
vfs_addstamp (oldvfs, oldvfsid);
|
||||||
|
@ -810,16 +810,20 @@ mc_open (const char *filename, int flags, ...)
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
|
||||||
#define MC_NAMEOP(name, inarg, callarg) \
|
#define MC_NAMEOP(name, inarg, callarg) \
|
||||||
int mc_##name inarg \
|
int mc_##name inarg \
|
||||||
{ \
|
{ \
|
||||||
struct vfs_class *vfs; \
|
struct vfs_class *vfs; \
|
||||||
int result; \
|
int result; \
|
||||||
char *mpath = vfs_canon_and_translate (path); \
|
char *mpath; \
|
||||||
|
mpath = vfs_canon_and_translate (path); \
|
||||||
if (mpath == NULL) \
|
if (mpath == NULL) \
|
||||||
return -1; \
|
return -1; \
|
||||||
vfs = vfs_get_class (mpath); \
|
vfs = vfs_get_class (mpath); \
|
||||||
if (vfs == NULL){ \
|
if (vfs == NULL) \
|
||||||
|
{ \
|
||||||
g_free (mpath); \
|
g_free (mpath); \
|
||||||
return -1; \
|
return -1; \
|
||||||
} \
|
} \
|
||||||
@ -830,14 +834,16 @@ int mc_##name inarg \
|
|||||||
return result; \
|
return result; \
|
||||||
}
|
}
|
||||||
|
|
||||||
MC_NAMEOP (chmod, (const char *path, mode_t mode), (vfs, mpath, mode));
|
MC_NAMEOP (chmod, (const char *path, mode_t mode), (vfs, mpath, mode))
|
||||||
MC_NAMEOP (chown, (const char *path, uid_t owner, gid_t group), (vfs, mpath, owner, group));
|
MC_NAMEOP (chown, (const char *path, uid_t owner, gid_t group), (vfs, mpath, owner, group))
|
||||||
MC_NAMEOP (utime, (const char *path, struct utimbuf * times), (vfs, mpath, times));
|
MC_NAMEOP (utime, (const char *path, struct utimbuf * times), (vfs, mpath, times))
|
||||||
MC_NAMEOP (readlink, (const char *path, char *buf, size_t bufsiz), (vfs, mpath, buf, bufsiz));
|
MC_NAMEOP (readlink, (const char *path, char *buf, size_t bufsiz), (vfs, mpath, buf, bufsiz))
|
||||||
MC_NAMEOP (unlink, (const char *path), (vfs, mpath));
|
MC_NAMEOP (unlink, (const char *path), (vfs, mpath))
|
||||||
MC_NAMEOP (mkdir, (const char *path, mode_t mode), (vfs, mpath, mode));
|
MC_NAMEOP (mkdir, (const char *path, mode_t mode), (vfs, mpath, mode))
|
||||||
MC_NAMEOP (rmdir, (const char *path), (vfs, mpath));
|
MC_NAMEOP (rmdir, (const char *path), (vfs, mpath))
|
||||||
MC_NAMEOP (mknod, (const char *path, mode_t mode, dev_t dev), (vfs, mpath, mode, dev));
|
MC_NAMEOP (mknod, (const char *path, mode_t mode, dev_t dev), (vfs, mpath, mode, dev))
|
||||||
|
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
@ -877,6 +883,8 @@ mc_symlink (const char *name1, const char *path)
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
|
||||||
#define MC_HANDLEOP(name, inarg, callarg) \
|
#define MC_HANDLEOP(name, inarg, callarg) \
|
||||||
ssize_t mc_##name inarg \
|
ssize_t mc_##name inarg \
|
||||||
{ \
|
{ \
|
||||||
@ -893,8 +901,8 @@ ssize_t mc_##name inarg \
|
|||||||
return result; \
|
return result; \
|
||||||
}
|
}
|
||||||
|
|
||||||
MC_HANDLEOP (read, (int handle, void *buffer, size_t count), (vfs_info (handle), buffer, count));
|
MC_HANDLEOP (read, (int handle, void *buffer, size_t count), (vfs_info (handle), buffer, count))
|
||||||
MC_HANDLEOP (write, (int handle, const void *buf, size_t nbyte), (vfs_info (handle), buf, nbyte));
|
MC_HANDLEOP (write, (int handle, const void *buf, size_t nbyte), (vfs_info (handle), buf, nbyte))
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
@ -928,11 +936,15 @@ int mc_##name (const char *fname1, const char *fname2) \
|
|||||||
return result; \
|
return result; \
|
||||||
}
|
}
|
||||||
|
|
||||||
MC_RENAMEOP (link) MC_RENAMEOP (rename);
|
MC_RENAMEOP (link)
|
||||||
|
MC_RENAMEOP (rename)
|
||||||
|
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int
|
int
|
||||||
mc_ctl (int handle, int ctlop, void *arg)
|
mc_ctl (int handle, int ctlop, void *arg)
|
||||||
{
|
{
|
||||||
struct vfs_class *vfs = vfs_op (handle);
|
struct vfs_class *vfs = vfs_op (handle);
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ load_text_from_clip_file (char **text)
|
|||||||
static gboolean
|
static gboolean
|
||||||
panel_save_curent_file_to_clip_file (void)
|
panel_save_curent_file_to_clip_file (void)
|
||||||
{
|
{
|
||||||
gboolean res;
|
gboolean res = FALSE;
|
||||||
|
|
||||||
if (current_panel->marked == 0)
|
if (current_panel->marked == 0)
|
||||||
res = save_text_to_clip_file (selection (current_panel)->fname);
|
res = save_text_to_clip_file (selection (current_panel)->fname);
|
||||||
|
@ -58,6 +58,7 @@
|
|||||||
#include "lib/strutil.h"
|
#include "lib/strutil.h"
|
||||||
#include "lib/util.h"
|
#include "lib/util.h"
|
||||||
#include "lib/widget.h"
|
#include "lib/widget.h"
|
||||||
|
#include "lib/keybind.h" /* CK_PanelMoveDown, CK_InputHistoryShow */
|
||||||
|
|
||||||
#include "src/subshell.h" /* use_subshell */
|
#include "src/subshell.h" /* use_subshell */
|
||||||
#include "src/consaver/cons.saver.h" /* console_flag */
|
#include "src/consaver/cons.saver.h" /* console_flag */
|
||||||
@ -66,7 +67,6 @@
|
|||||||
#include "src/setup.h"
|
#include "src/setup.h"
|
||||||
#include "src/execute.h" /* toggle_panels() */
|
#include "src/execute.h" /* toggle_panels() */
|
||||||
#include "src/history.h"
|
#include "src/history.h"
|
||||||
#include "src/keybind-defaults.h" /* CK_InputHistoryShow */
|
|
||||||
|
|
||||||
#ifdef USE_INTERNAL_EDIT
|
#ifdef USE_INTERNAL_EDIT
|
||||||
#include "src/editor/edit.h"
|
#include "src/editor/edit.h"
|
||||||
@ -956,12 +956,11 @@ filter_cmd (void)
|
|||||||
void
|
void
|
||||||
reread_cmd (void)
|
reread_cmd (void)
|
||||||
{
|
{
|
||||||
int flag;
|
panel_update_flags_t flag = UP_ONLY_CURRENT;
|
||||||
|
|
||||||
if (get_current_type () == view_listing && get_other_type () == view_listing)
|
if (get_current_type () == view_listing && get_other_type () == view_listing
|
||||||
flag = strcmp (current_panel->cwd, other_panel->cwd) ? UP_ONLY_CURRENT : 0;
|
&& strcmp (current_panel->cwd, other_panel->cwd) == 0)
|
||||||
else
|
flag = UP_OPTIMIZE;
|
||||||
flag = UP_ONLY_CURRENT;
|
|
||||||
|
|
||||||
update_panels (UP_RELOAD | flag, UP_KEEPSEL);
|
update_panels (UP_RELOAD | flag, UP_KEEPSEL);
|
||||||
repaint_screen ();
|
repaint_screen ();
|
||||||
@ -1513,7 +1512,7 @@ single_dirsize_cmd (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (panels_options.mark_moves_down)
|
if (panels_options.mark_moves_down)
|
||||||
send_message (&panel->widget, WIDGET_KEY, KEY_DOWN);
|
send_message ((Widget *) panel, WIDGET_COMMAND, CK_PanelMoveDown);
|
||||||
|
|
||||||
recalculate_panel_summary (panel);
|
recalculate_panel_summary (panel);
|
||||||
|
|
||||||
|
@ -462,30 +462,24 @@ real_warn_same_file (enum OperationMode mode, const char *fmt, const char *a, co
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#ifdef WITH_BACKGROUND
|
|
||||||
static FileProgressStatus
|
static FileProgressStatus
|
||||||
warn_same_file (const char *fmt, const char *a, const char *b)
|
warn_same_file (const char *fmt, const char *a, const char *b)
|
||||||
{
|
{
|
||||||
|
#ifdef WITH_BACKGROUND
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
void *p;
|
void *p;
|
||||||
FileProgressStatus (*f) (enum OperationMode, const char *fmt,
|
FileProgressStatus (*f) (enum OperationMode, const char *fmt,
|
||||||
const char *a, const char *b);
|
const char *a, const char *b);
|
||||||
} pntr;
|
} pntr;
|
||||||
|
|
||||||
pntr.f = real_warn_same_file;
|
pntr.f = real_warn_same_file;
|
||||||
|
|
||||||
if (we_are_background)
|
if (we_are_background)
|
||||||
return parent_call (pntr.p, NULL, 3, strlen (fmt), fmt, strlen (a), a, strlen (b), b);
|
return parent_call (pntr.p, NULL, 3, strlen (fmt), fmt, strlen (a), a, strlen (b), b);
|
||||||
else
|
|
||||||
return real_warn_same_file (Foreground, fmt, a, b);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static FileProgressStatus
|
|
||||||
warn_same_file (const char *fmt, const char *a, const char *b)
|
|
||||||
{
|
|
||||||
return real_warn_same_file (Foreground, fmt, a, b);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
return real_warn_same_file (Foreground, fmt, a, b);
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
@ -3268,12 +3268,12 @@ reload_panelized (WPanel * panel)
|
|||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
update_one_panel_widget (WPanel * panel, int force_update, const char *current_file)
|
update_one_panel_widget (WPanel * panel, panel_update_flags_t flags, const char *current_file)
|
||||||
{
|
{
|
||||||
int free_pointer;
|
gboolean free_pointer;
|
||||||
char *my_current_file = NULL;
|
char *my_current_file = NULL;
|
||||||
|
|
||||||
if (force_update & UP_RELOAD)
|
if ((flags & UP_RELOAD) != 0)
|
||||||
{
|
{
|
||||||
panel->is_panelized = 0;
|
panel->is_panelized = 0;
|
||||||
mc_setctl (panel->cwd, VFS_SETCTL_FLUSH, 0);
|
mc_setctl (panel->cwd, VFS_SETCTL_FLUSH, 0);
|
||||||
@ -3281,14 +3281,13 @@ update_one_panel_widget (WPanel * panel, int force_update, const char *current_f
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If current_file == -1 (an invalid pointer) then preserve selection */
|
/* If current_file == -1 (an invalid pointer) then preserve selection */
|
||||||
if (current_file == UP_KEEPSEL)
|
free_pointer = current_file == UP_KEEPSEL;
|
||||||
|
|
||||||
|
if (free_pointer)
|
||||||
{
|
{
|
||||||
free_pointer = 1;
|
|
||||||
my_current_file = g_strdup (panel->dir.list[panel->selected].fname);
|
my_current_file = g_strdup (panel->dir.list[panel->selected].fname);
|
||||||
current_file = my_current_file;
|
current_file = my_current_file;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
free_pointer = 0;
|
|
||||||
|
|
||||||
if (panel->is_panelized)
|
if (panel->is_panelized)
|
||||||
reload_panelized (panel);
|
reload_panelized (panel);
|
||||||
@ -3305,13 +3304,13 @@ update_one_panel_widget (WPanel * panel, int force_update, const char *current_f
|
|||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
update_one_panel (int which, int force_update, const char *current_file)
|
update_one_panel (int which, panel_update_flags_t flags, const char *current_file)
|
||||||
{
|
{
|
||||||
if (get_display_type (which) == view_listing)
|
if (get_display_type (which) == view_listing)
|
||||||
{
|
{
|
||||||
WPanel *panel;
|
WPanel *panel;
|
||||||
panel = (WPanel *) get_panel_widget (which);
|
panel = (WPanel *) get_panel_widget (which);
|
||||||
update_one_panel_widget (panel, force_update, current_file);
|
update_one_panel_widget (panel, flags, current_file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3995,15 +3994,15 @@ panel_change_encoding (WPanel * panel)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
update_panels (int force_update, const char *current_file)
|
update_panels (panel_update_flags_t flags, const char *current_file)
|
||||||
{
|
{
|
||||||
int reload_other = !(force_update & UP_ONLY_CURRENT);
|
gboolean reload_other = (flags & UP_ONLY_CURRENT) == 0;
|
||||||
WPanel *panel;
|
WPanel *panel;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
update_one_panel (get_current_index (), force_update, current_file);
|
update_one_panel (get_current_index (), flags, current_file);
|
||||||
if (reload_other)
|
if (reload_other)
|
||||||
update_one_panel (get_other_index (), force_update, UP_KEEPSEL);
|
update_one_panel (get_other_index (), flags, UP_KEEPSEL);
|
||||||
|
|
||||||
if (get_current_type () == view_listing)
|
if (get_current_type () == view_listing)
|
||||||
panel = (WPanel *) get_panel_widget (get_current_index ());
|
panel = (WPanel *) get_panel_widget (get_current_index ());
|
||||||
|
@ -23,10 +23,6 @@
|
|||||||
|
|
||||||
#define LIST_TYPES 4
|
#define LIST_TYPES 4
|
||||||
|
|
||||||
#define UP_OPTIMIZE 0
|
|
||||||
#define UP_RELOAD 1
|
|
||||||
#define UP_ONLY_CURRENT 2
|
|
||||||
|
|
||||||
#define UP_KEEPSEL ((char *) -1)
|
#define UP_KEEPSEL ((char *) -1)
|
||||||
|
|
||||||
/*** enums ***************************************************************************************/
|
/*** enums ***************************************************************************************/
|
||||||
@ -54,6 +50,13 @@ enum panel_display_enum
|
|||||||
frame_half /* half screen frame */
|
frame_half /* half screen frame */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
UP_OPTIMIZE = 0,
|
||||||
|
UP_RELOAD = 1,
|
||||||
|
UP_ONLY_CURRENT = 2
|
||||||
|
} panel_update_flags_t;
|
||||||
|
|
||||||
/*** structures declarations (and typedefs of structures)*****************************************/
|
/*** structures declarations (and typedefs of structures)*****************************************/
|
||||||
|
|
||||||
struct format_e;
|
struct format_e;
|
||||||
@ -142,7 +145,7 @@ void panel_re_sort (WPanel * panel);
|
|||||||
void panel_change_encoding (WPanel * panel);
|
void panel_change_encoding (WPanel * panel);
|
||||||
|
|
||||||
void update_dirty_panels (void);
|
void update_dirty_panels (void);
|
||||||
void update_panels (int force_update, const char *current_file);
|
void update_panels (panel_update_flags_t flags, const char *current_file);
|
||||||
void panel_update_cols (Widget * widget, int frame_size);
|
void panel_update_cols (Widget * widget, int frame_size);
|
||||||
int set_panel_formats (WPanel * p);
|
int set_panel_formats (WPanel * p);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user