![Andrew Borodin](/assets/img/avatar_default.png)
Formerly, each widget saved its history self in WIDGET_DESTROY stage. Thus, history file was read and written as many times as many widgets with history are in dialog. Now all widget histories are written to ${XDG_CACHE_HOME}/mc/history file at one time before dialog destruction. An ev_history_load_save_t event type is created to use new event engine to save histories. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
38 строки
1.3 KiB
C
38 строки
1.3 KiB
C
|
|
/** \file history.h
|
|
* \brief Header: save, load and show history
|
|
*/
|
|
|
|
#ifndef MC__WIDGET_HISTORY_H
|
|
#define MC__WIDGET_HISTORY_H
|
|
|
|
/*** typedefs(not structures) and defined constants **********************************************/
|
|
|
|
/*** enums ***************************************************************************************/
|
|
|
|
/*** structures declarations (and typedefs of structures)*****************************************/
|
|
|
|
/* forward declaration */
|
|
struct mc_config_t;
|
|
|
|
/*** global variables defined in .c file *********************************************************/
|
|
|
|
extern int num_history_items_recorded;
|
|
|
|
/*** declarations of public functions ************************************************************/
|
|
|
|
GList *history_get (const char *input_name);
|
|
/* save history to the mc_config, but don't save config to file */
|
|
void history_save (struct mc_config_t * cfg, const char *name, GList * h);
|
|
#if 0
|
|
/* write history to the ${XDG_CACHE_HOME}/mc/history file */
|
|
void history_put (const char *input_name, GList * h);
|
|
#endif
|
|
/* for repositioning of history dialog we should pass widget to this
|
|
* function, as position of history dialog depends on widget's position */
|
|
char *history_show (GList ** history, Widget * widget);
|
|
|
|
/*** inline functions ****************************************************************************/
|
|
|
|
#endif /* MC__WIDGET_HISTORY_H */
|