(save_panel_dir): minor refactoring.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2019-08-17 14:07:05 +03:00
parent 97bc63d7ac
commit 07d2f11712

View File

@ -1345,16 +1345,20 @@ get_other_type (void)
void void
save_panel_dir (int idx) save_panel_dir (int idx)
{ {
panel_view_mode_t type = get_panel_type (idx); panel_view_mode_t type;
Widget *widget = get_panel_widget (idx);
if ((type == view_listing) && (widget != NULL)) type = get_panel_type (idx);
if (type == view_listing)
{ {
WPanel *w = PANEL (widget); WPanel *p;
g_free (panels[idx].last_saved_dir); /* last path no needed */ p = PANEL (get_panel_widget (idx));
/* Because path can be nonlocal */ if (p != NULL)
panels[idx].last_saved_dir = g_strdup (vfs_path_as_str (w->cwd_vpath)); {
g_free (panels[idx].last_saved_dir); /* last path no needed */
/* Because path can be nonlocal */
panels[idx].last_saved_dir = g_strdup (vfs_path_as_str (p->cwd_vpath));
}
} }
} }