Ticket #3767: 0001-Document-panelization-related-code.patch

File 0001-Document-panelization-related-code.patch, 2.6 KB (added by mooffie, 3 years ago)
  • src/filemanager/panel.c

    From 9cc4d3ab1a03f44fe4852889c79376c0f48e8cbe Mon Sep 17 00:00:00 2001
    From: Mooffie <mooffie@gmail.com>
    Date: Sat, 18 Feb 2017 20:30:36 +0200
    Subject: [PATCH 1/4] Document panelization-related code.
    
    Signed-off-by: Mooffie <mooffie@gmail.com>
    ---
     src/filemanager/panel.c    | 11 +++++++++++
     src/filemanager/panelize.c | 16 ++++++++++++++--
     2 files changed, 25 insertions(+), 2 deletions(-)
    
    diff --git a/src/filemanager/panel.c b/src/filemanager/panel.c
    index 1a41001..a1e3b73 100644
    a b  
    8383/* The hook list for the select file function */ 
    8484hook_t *select_file_hook = NULL; 
    8585 
     86/* 
     87 * 'panelized_panel' is a place where a list of files can be stored. 
     88 * 
     89 * Right after running "Find file" or "External panelize" (@todo), the contents of 
     90 * the panelized panel gets stored here. This makes it possible for the 
     91 * user to come back to this listing later if he exits panelization mode. 
     92 * 
     93 * @todo: Make this a static variable of 'panelize.c' and don't use it in 
     94 * this file. Figure out if panelized_panel.root_vpath should really be used 
     95 * here. 
     96 */ 
    8697/* *INDENT-OFF* */ 
    8798panelized_panel_t panelized_panel = { {NULL, 0, -1}, NULL }; 
    8899/* *INDENT-ON* */ 
  • src/filemanager/panelize.c

    diff --git a/src/filemanager/panelize.c b/src/filemanager/panelize.c
    index 15792ff..d7fdb60 100644
    a b do_external_panelize (char *command) 
    381381 
    382382/* --------------------------------------------------------------------------------------------- */ 
    383383 
     384/** 
     385 * Restores the contents of the panel from a previously saved snapshot (the 
     386 * variable 'panelized_panel'). 
     387 * 
     388 * This is the opposite of panelize_save_panel(). 
     389 */ 
    384390static void 
    385 do_panelize_cd (WPanel * panel) 
     391panelize_restore_panel (WPanel * panel) 
    386392{ 
    387393    int i; 
    388394    dir_list *list; 
    panelize_change_root (const vfs_path_t * new_root) 
    452458 
    453459/* --------------------------------------------------------------------------------------------- */ 
    454460 
     461/** 
     462 * Stores the contents of the panel into a snapshot (the variable 
     463 * 'panelized_panel') so it may be restored later. 
     464 * 
     465 * This is the opposite of panelize_restore_panel(). 
     466 */ 
    455467void 
    456468panelize_save_panel (WPanel * panel) 
    457469{ 
    cd_panelize_cmd (void) 
    492504    if (!SELECTED_IS_PANEL) 
    493505        set_display_type (MENU_PANEL_IDX, view_listing); 
    494506 
    495     do_panelize_cd (PANEL (get_panel_widget (MENU_PANEL_IDX))); 
     507    panelize_restore_panel (PANEL (get_panel_widget (MENU_PANEL_IDX))); 
    496508} 
    497509 
    498510/* --------------------------------------------------------------------------------------------- */