mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
Get rid of some '#ifdef ENABLE_VFS' conditions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
c36a810c09
commit
ec8d6f0751
@ -42,10 +42,6 @@
|
||||
|
||||
#include "lib/vfs/mc-vfs/vfs.h"
|
||||
|
||||
#ifdef ENABLE_VFS
|
||||
#include "lib/vfs/mc-vfs/gc.h"
|
||||
#endif /* ENABLE_VFS */
|
||||
|
||||
#include "tty.h"
|
||||
#include "tty-internal.h" /* mouse_enabled */
|
||||
#include "mouse.h"
|
||||
|
@ -20,8 +20,6 @@ struct vfs_stamping
|
||||
void vfs_stamp (struct vfs_class *vclass, vfsid id);
|
||||
void vfs_rmstamp (struct vfs_class *vclass, vfsid id);
|
||||
void vfs_stamp_create (struct vfs_class *vclass, vfsid id);
|
||||
void vfs_timeout_handler (void);
|
||||
int vfs_timeouts (void);
|
||||
vfsid vfs_getid (struct vfs_class *vclass, const char *dir);
|
||||
void vfs_gc_done (void);
|
||||
|
||||
|
@ -45,6 +45,8 @@ extern int vfs_timeout;
|
||||
extern int use_netrc;
|
||||
#endif
|
||||
|
||||
void vfs_timeout_handler (void);
|
||||
int vfs_timeouts (void);
|
||||
void vfs_expire (int now);
|
||||
|
||||
gboolean vfs_current_is_local (void);
|
||||
|
@ -507,12 +507,8 @@ edit_set_filename (WEdit * edit, const char *f)
|
||||
if (!f)
|
||||
f = "";
|
||||
edit->filename = g_strdup (f);
|
||||
if (edit->dir == NULL && *f != PATH_SEP)
|
||||
#ifdef ENABLE_VFS
|
||||
if (edit->dir == NULL && !g_path_is_absolute (f))
|
||||
edit->dir = g_strdup (vfs_get_current_dir ());
|
||||
#else /* ENABLE_VFS */
|
||||
edit->dir = g_get_current_dir ();
|
||||
#endif /* ENABLE_VFS */
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -119,12 +119,10 @@ do_execute (const char *lc_shell, const char *command, int flags)
|
||||
char *new_dir = NULL;
|
||||
#endif /* HAVE_SUBSHELL_SUPPORT */
|
||||
|
||||
#ifdef ENABLE_VFS
|
||||
char *old_vfs_dir = 0;
|
||||
|
||||
if (!vfs_current_is_local ())
|
||||
old_vfs_dir = g_strdup (vfs_get_current_dir ());
|
||||
#endif /* ENABLE_VFS */
|
||||
|
||||
if (mc_run_mode == MC_RUN_FULL)
|
||||
save_cwds_stat ();
|
||||
@ -143,11 +141,7 @@ do_execute (const char *lc_shell, const char *command, int flags)
|
||||
do_update_prompt ();
|
||||
|
||||
/* We don't care if it died, higher level takes care of this */
|
||||
#ifdef ENABLE_VFS
|
||||
invoke_subshell (command, VISIBLY, old_vfs_dir ? NULL : &new_dir);
|
||||
#else
|
||||
invoke_subshell (command, VISIBLY, &new_dir);
|
||||
#endif /* !ENABLE_VFS */
|
||||
}
|
||||
else
|
||||
#endif /* HAVE_SUBSHELL_SUPPORT */
|
||||
@ -190,13 +184,11 @@ do_execute (const char *lc_shell, const char *command, int flags)
|
||||
|
||||
#endif /* HAVE_SUBSHELL_SUPPORT */
|
||||
|
||||
#ifdef ENABLE_VFS
|
||||
if (old_vfs_dir)
|
||||
{
|
||||
mc_chdir (old_vfs_dir);
|
||||
g_free (old_vfs_dir);
|
||||
}
|
||||
#endif /* ENABLE_VFS */
|
||||
|
||||
if (mc_run_mode == MC_RUN_FULL)
|
||||
{
|
||||
|
12
src/main.c
12
src/main.c
@ -1426,17 +1426,13 @@ done_mc (void)
|
||||
}
|
||||
done_screen ();
|
||||
|
||||
#ifdef ENABLE_VFS
|
||||
vfs_stamp_path (vfs_get_current_dir ());
|
||||
|
||||
if ((current_panel != NULL)
|
||||
&& (get_current_type () == view_listing))
|
||||
vfs_stamp_path (current_panel->cwd);
|
||||
if ((current_panel != NULL) && (get_current_type () == view_listing))
|
||||
vfs_stamp_path (current_panel->cwd);
|
||||
|
||||
if ((other_panel != NULL)
|
||||
&& (get_other_type () == view_listing))
|
||||
vfs_stamp_path (other_panel->cwd);
|
||||
#endif
|
||||
if ((other_panel != NULL) && (get_other_type () == view_listing))
|
||||
vfs_stamp_path (other_panel->cwd);
|
||||
}
|
||||
|
||||
static cb_ret_t
|
||||
|
@ -2540,7 +2540,7 @@ do_enter_on_file_entry (file_entry * fe)
|
||||
_("Do you really want to execute?"), D_NORMAL, 2, _("&Yes"), _("&No")) != 0)
|
||||
return 1;
|
||||
}
|
||||
#ifdef ENABLE_VFS
|
||||
|
||||
if (!vfs_current_is_local ())
|
||||
{
|
||||
char *tmp;
|
||||
@ -2553,7 +2553,6 @@ do_enter_on_file_entry (file_entry * fe)
|
||||
* was successful */
|
||||
return confirm_execute || (ret == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
{
|
||||
char *tmp = name_quote (fe->fname, 0);
|
||||
|
@ -295,13 +295,7 @@ mcview_load (mcview_t * view, const char *command, const char *file, int start_l
|
||||
if ((view->workdir == NULL) && (file != NULL))
|
||||
{
|
||||
if (!g_path_is_absolute (file))
|
||||
{
|
||||
#ifdef ENABLE_VFS
|
||||
view->workdir = g_strdup (vfs_get_current_dir ());
|
||||
#else /* ENABLE_VFS */
|
||||
view->workdir = g_get_current_dir ();
|
||||
#endif /* ENABLE_VFS */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* try extract path form filename */
|
||||
@ -313,11 +307,7 @@ mcview_load (mcview_t * view, const char *command, const char *file, int start_l
|
||||
else
|
||||
{
|
||||
g_free (dirname);
|
||||
#ifdef ENABLE_VFS
|
||||
view->workdir = g_strdup (vfs_get_current_dir ());
|
||||
#else /* ENABLE_VFS */
|
||||
view->workdir = g_get_current_dir ();
|
||||
#endif /* ENABLE_VFS */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user