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
|
|
83 | 83 | /* The hook list for the select file function */ |
84 | 84 | hook_t *select_file_hook = NULL; |
85 | 85 | |
| 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 | */ |
86 | 97 | /* *INDENT-OFF* */ |
87 | 98 | panelized_panel_t panelized_panel = { {NULL, 0, -1}, NULL }; |
88 | 99 | /* *INDENT-ON* */ |
diff --git a/src/filemanager/panelize.c b/src/filemanager/panelize.c
index 15792ff..d7fdb60 100644
a
|
b
|
do_external_panelize (char *command) |
381 | 381 | |
382 | 382 | /* --------------------------------------------------------------------------------------------- */ |
383 | 383 | |
| 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 | */ |
384 | 390 | static void |
385 | | do_panelize_cd (WPanel * panel) |
| 391 | panelize_restore_panel (WPanel * panel) |
386 | 392 | { |
387 | 393 | int i; |
388 | 394 | dir_list *list; |
… |
… |
panelize_change_root (const vfs_path_t * new_root) |
452 | 458 | |
453 | 459 | /* --------------------------------------------------------------------------------------------- */ |
454 | 460 | |
| 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 | */ |
455 | 467 | void |
456 | 468 | panelize_save_panel (WPanel * panel) |
457 | 469 | { |
… |
… |
cd_panelize_cmd (void) |
492 | 504 | if (!SELECTED_IS_PANEL) |
493 | 505 | set_display_type (MENU_PANEL_IDX, view_listing); |
494 | 506 | |
495 | | do_panelize_cd (PANEL (get_panel_widget (MENU_PANEL_IDX))); |
| 507 | panelize_restore_panel (PANEL (get_panel_widget (MENU_PANEL_IDX))); |
496 | 508 | } |
497 | 509 | |
498 | 510 | /* --------------------------------------------------------------------------------------------- */ |