From a4440ba8e5886f3d0375c840d6147eebbe32a81c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 14 Mar 2021 10:54:44 +0100 Subject: buflist: add buflist bar on configuration reload (issue #1618) --- src/plugins/buflist/buflist-config.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/buflist/buflist-config.c b/src/plugins/buflist/buflist-config.c index a0691da90..0e30d4c37 100644 --- a/src/plugins/buflist/buflist-config.c +++ b/src/plugins/buflist/buflist-config.c @@ -69,6 +69,27 @@ char *buflist_config_format_buffer_current_eval = NULL; char *buflist_config_format_hotlist_eval = NULL; +/* + * Reloads buflist configuration file. + */ + +int +buflist_config_reload (const void *pointer, void *data, + struct t_config_file *config_file) +{ + int rc; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + rc = weechat_config_reload (config_file); + + buflist_add_bar (); + + return rc; +} + /* * Frees the signals hooked for refresh. */ @@ -444,8 +465,9 @@ buflist_config_init () { struct t_config_section *ptr_section; - buflist_config_file = weechat_config_new (BUFLIST_CONFIG_NAME, - NULL, NULL, NULL); + buflist_config_file = weechat_config_new ( + BUFLIST_CONFIG_NAME, + &buflist_config_reload, NULL, NULL); if (!buflist_config_file) return 0; -- cgit v1.2.3