Get rid of some '#ifdef ENABLE_VFS' conditions.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2010-07-26 14:52:56 +04:00
parent c36a810c09
commit ec8d6f0751
8 changed files with 8 additions and 39 deletions

View File

@ -42,10 +42,6 @@
#include "lib/vfs/mc-vfs/vfs.h" #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.h"
#include "tty-internal.h" /* mouse_enabled */ #include "tty-internal.h" /* mouse_enabled */
#include "mouse.h" #include "mouse.h"

View File

@ -20,8 +20,6 @@ struct vfs_stamping
void vfs_stamp (struct vfs_class *vclass, vfsid id); void vfs_stamp (struct vfs_class *vclass, vfsid id);
void vfs_rmstamp (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_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); vfsid vfs_getid (struct vfs_class *vclass, const char *dir);
void vfs_gc_done (void); void vfs_gc_done (void);

View File

@ -45,6 +45,8 @@ extern int vfs_timeout;
extern int use_netrc; extern int use_netrc;
#endif #endif
void vfs_timeout_handler (void);
int vfs_timeouts (void);
void vfs_expire (int now); void vfs_expire (int now);
gboolean vfs_current_is_local (void); gboolean vfs_current_is_local (void);

View File

@ -507,12 +507,8 @@ edit_set_filename (WEdit * edit, const char *f)
if (!f) if (!f)
f = ""; f = "";
edit->filename = g_strdup (f); edit->filename = g_strdup (f);
if (edit->dir == NULL && *f != PATH_SEP) if (edit->dir == NULL && !g_path_is_absolute (f))
#ifdef ENABLE_VFS
edit->dir = g_strdup (vfs_get_current_dir ()); edit->dir = g_strdup (vfs_get_current_dir ());
#else /* ENABLE_VFS */
edit->dir = g_get_current_dir ();
#endif /* ENABLE_VFS */
} }
static gboolean static gboolean

View File

@ -119,12 +119,10 @@ do_execute (const char *lc_shell, const char *command, int flags)
char *new_dir = NULL; char *new_dir = NULL;
#endif /* HAVE_SUBSHELL_SUPPORT */ #endif /* HAVE_SUBSHELL_SUPPORT */
#ifdef ENABLE_VFS
char *old_vfs_dir = 0; char *old_vfs_dir = 0;
if (!vfs_current_is_local ()) if (!vfs_current_is_local ())
old_vfs_dir = g_strdup (vfs_get_current_dir ()); old_vfs_dir = g_strdup (vfs_get_current_dir ());
#endif /* ENABLE_VFS */
if (mc_run_mode == MC_RUN_FULL) if (mc_run_mode == MC_RUN_FULL)
save_cwds_stat (); save_cwds_stat ();
@ -143,11 +141,7 @@ do_execute (const char *lc_shell, const char *command, int flags)
do_update_prompt (); do_update_prompt ();
/* We don't care if it died, higher level takes care of this */ /* 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); invoke_subshell (command, VISIBLY, old_vfs_dir ? NULL : &new_dir);
#else
invoke_subshell (command, VISIBLY, &new_dir);
#endif /* !ENABLE_VFS */
} }
else else
#endif /* HAVE_SUBSHELL_SUPPORT */ #endif /* HAVE_SUBSHELL_SUPPORT */
@ -190,13 +184,11 @@ do_execute (const char *lc_shell, const char *command, int flags)
#endif /* HAVE_SUBSHELL_SUPPORT */ #endif /* HAVE_SUBSHELL_SUPPORT */
#ifdef ENABLE_VFS
if (old_vfs_dir) if (old_vfs_dir)
{ {
mc_chdir (old_vfs_dir); mc_chdir (old_vfs_dir);
g_free (old_vfs_dir); g_free (old_vfs_dir);
} }
#endif /* ENABLE_VFS */
if (mc_run_mode == MC_RUN_FULL) if (mc_run_mode == MC_RUN_FULL)
{ {

View File

@ -1426,17 +1426,13 @@ done_mc (void)
} }
done_screen (); done_screen ();
#ifdef ENABLE_VFS
vfs_stamp_path (vfs_get_current_dir ()); vfs_stamp_path (vfs_get_current_dir ());
if ((current_panel != NULL) if ((current_panel != NULL) && (get_current_type () == view_listing))
&& (get_current_type () == view_listing)) vfs_stamp_path (current_panel->cwd);
vfs_stamp_path (current_panel->cwd);
if ((other_panel != NULL) if ((other_panel != NULL) && (get_other_type () == view_listing))
&& (get_other_type () == view_listing)) vfs_stamp_path (other_panel->cwd);
vfs_stamp_path (other_panel->cwd);
#endif
} }
static cb_ret_t static cb_ret_t

View File

@ -2540,7 +2540,7 @@ do_enter_on_file_entry (file_entry * fe)
_("Do you really want to execute?"), D_NORMAL, 2, _("&Yes"), _("&No")) != 0) _("Do you really want to execute?"), D_NORMAL, 2, _("&Yes"), _("&No")) != 0)
return 1; return 1;
} }
#ifdef ENABLE_VFS
if (!vfs_current_is_local ()) if (!vfs_current_is_local ())
{ {
char *tmp; char *tmp;
@ -2553,7 +2553,6 @@ do_enter_on_file_entry (file_entry * fe)
* was successful */ * was successful */
return confirm_execute || (ret == 0); return confirm_execute || (ret == 0);
} }
#endif
{ {
char *tmp = name_quote (fe->fname, 0); char *tmp = name_quote (fe->fname, 0);

View File

@ -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 ((view->workdir == NULL) && (file != NULL))
{ {
if (!g_path_is_absolute (file)) if (!g_path_is_absolute (file))
{
#ifdef ENABLE_VFS
view->workdir = g_strdup (vfs_get_current_dir ()); view->workdir = g_strdup (vfs_get_current_dir ());
#else /* ENABLE_VFS */
view->workdir = g_get_current_dir ();
#endif /* ENABLE_VFS */
}
else else
{ {
/* try extract path form filename */ /* try extract path form filename */
@ -313,11 +307,7 @@ mcview_load (mcview_t * view, const char *command, const char *file, int start_l
else else
{ {
g_free (dirname); g_free (dirname);
#ifdef ENABLE_VFS
view->workdir = g_strdup (vfs_get_current_dir ()); view->workdir = g_strdup (vfs_get_current_dir ());
#else /* ENABLE_VFS */
view->workdir = g_get_current_dir ();
#endif /* ENABLE_VFS */
} }
} }
} }