diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2011-11-17 22:11:39 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2011-11-17 22:11:39 +0100 |
commit | 61e5a4bcdb5c599b10ca99b906fb7ba3690ab4cb (patch) | |
tree | cc08f023be694c2ce9fae3084071483cac973de0 | |
parent | 07727a97c97100b46e895ce079d49a8d6db0d0ee (diff) | |
download | weechat-61e5a4bcdb5c599b10ca99b906fb7ba3690ab4cb.zip |
core: apply filters after full reload of configuration files (with /reload) (bug #31182)
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/core/wee-command.c | 15 | ||||
-rw-r--r-- | src/core/wee-config.c | 10 | ||||
-rw-r--r-- | src/gui/gui-filter.c | 32 | ||||
-rw-r--r-- | src/gui/gui-filter.h | 3 |
5 files changed, 19 insertions, 45 deletions
@@ -1,12 +1,14 @@ WeeChat ChangeLog ================= Sébastien Helleu <flashcode@flashtux.org> -v0.3.7-dev, 2011-11-15 +v0.3.7-dev, 2011-11-17 Version 0.3.7 (under dev!) -------------------------- +* core: apply filters after full reload of configuration files (with /reload) + (bug #31182) * core: allow list for option weechat.plugin.extension (makes weechat.conf portable accross Un*x and Windows) (task #11479) * core: fix compilation under OpenBSD 5.0 (lib utf8 not needed any more) diff --git a/src/core/wee-command.c b/src/core/wee-command.c index 6bbd59035..784073904 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -1466,7 +1466,8 @@ COMMAND_CALLBACK(filter) { if (!ptr_filter->enabled) { - gui_filter_enable (ptr_filter); + ptr_filter->enabled = 1; + gui_filter_all_buffers (); gui_chat_printf_date_tags (NULL, 0, GUI_FILTER_TAG_NO_FILTER, _("Filter \"%s\" enabled"), ptr_filter->name); @@ -1505,7 +1506,8 @@ COMMAND_CALLBACK(filter) { if (ptr_filter->enabled) { - gui_filter_disable (ptr_filter); + ptr_filter->enabled = 0; + gui_filter_all_buffers (); gui_chat_printf_date_tags (NULL, 0, GUI_FILTER_TAG_NO_FILTER, _("Filter \"%s\" disabled"), ptr_filter->name); @@ -1542,10 +1544,8 @@ COMMAND_CALLBACK(filter) ptr_filter = gui_filter_search_by_name (argv[2]); if (ptr_filter) { - if (ptr_filter->enabled) - gui_filter_disable (ptr_filter); - else - gui_filter_enable (ptr_filter); + ptr_filter->enabled ^= 1; + gui_filter_all_buffers (); } else { @@ -1598,6 +1598,7 @@ COMMAND_CALLBACK(filter) if (ptr_filter) { + gui_filter_all_buffers (); gui_chat_printf (NULL, ""); gui_chat_printf_date_tags (NULL, 0, GUI_FILTER_TAG_NO_FILTER, _("Filter \"%s\" added:"), @@ -1658,6 +1659,7 @@ COMMAND_CALLBACK(filter) if (gui_filters) { gui_filter_free_all (); + gui_filter_all_buffers (); gui_chat_printf_date_tags (NULL, 0, GUI_FILTER_TAG_NO_FILTER, _("All filters have been deleted")); } @@ -1673,6 +1675,7 @@ COMMAND_CALLBACK(filter) if (ptr_filter) { gui_filter_free (ptr_filter); + gui_filter_all_buffers (); gui_chat_printf_date_tags (NULL, 0, GUI_FILTER_TAG_NO_FILTER, _("Filter \"%s\" deleted"), argv[2]); diff --git a/src/core/wee-config.c b/src/core/wee-config.c index ac4f712ac..cb612bf8d 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -661,6 +661,9 @@ config_weechat_init_after_read () if (!gui_keys[i]) gui_key_default_bindings (i); } + + /* apply filters on all buffers */ + gui_filter_all_buffers (); } /* @@ -704,8 +707,7 @@ config_weechat_reload_cb (void *data, struct t_config_file *config_file) rc = config_file_reload (config_file); - if (rc == WEECHAT_CONFIG_READ_OK) - config_weechat_init_after_read (); + config_weechat_init_after_read (); return rc; } @@ -2783,8 +2785,8 @@ config_weechat_read () int rc; rc = config_file_read (weechat_config_file); - if (rc == WEECHAT_CONFIG_READ_OK) - config_weechat_init_after_read (); + + config_weechat_init_after_read (); if (rc != WEECHAT_CONFIG_READ_OK) { diff --git a/src/gui/gui-filter.c b/src/gui/gui-filter.c index 608dcc347..c1da95e1d 100644 --- a/src/gui/gui-filter.c +++ b/src/gui/gui-filter.c @@ -222,34 +222,6 @@ gui_filter_global_disable () } /* - * gui_filter_enable: enable a filter - */ - -void -gui_filter_enable (struct t_gui_filter *filter) -{ - if (filter && !filter->enabled) - { - filter->enabled = 1; - gui_filter_all_buffers (); - } -} - -/* - * gui_filter_disable: disable a filter - */ - -void -gui_filter_disable (struct t_gui_filter *filter) -{ - if (filter && filter->enabled) - { - filter->enabled = 0; - gui_filter_all_buffers (); - } -} - -/* * gui_filter_search_by_name: search a filter by name */ @@ -382,8 +354,6 @@ gui_filter_new (int enabled, const char *name, const char *buffer_name, last_gui_filter = new_filter; new_filter->next_filter = NULL; - gui_filter_all_buffers (); - hook_signal_send ("filter_added", WEECHAT_HOOK_SIGNAL_POINTER, new_filter); } @@ -456,8 +426,6 @@ gui_filter_free (struct t_gui_filter *filter) free (filter); - gui_filter_all_buffers (); - hook_signal_send ("filter_removed", WEECHAT_HOOK_SIGNAL_STRING, NULL); } diff --git a/src/gui/gui-filter.h b/src/gui/gui-filter.h index a853bca86..b1fc745b8 100644 --- a/src/gui/gui-filter.h +++ b/src/gui/gui-filter.h @@ -55,10 +55,9 @@ extern int gui_filters_enabled; extern int gui_filter_check_line (struct t_gui_line *line, const char *buffer_full_name); +extern void gui_filter_all_buffers (); extern void gui_filter_global_enable (); extern void gui_filter_global_disable (); -extern void gui_filter_enable (struct t_gui_filter *filter); -extern void gui_filter_disable (struct t_gui_filter *filter); extern struct t_gui_filter *gui_filter_search_by_name (const char *name); extern struct t_gui_filter *gui_filter_new (int enabled, const char *name, |