summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui-filter.c27
-rw-r--r--src/gui/gui-filter.h2
2 files changed, 26 insertions, 3 deletions
diff --git a/src/gui/gui-filter.c b/src/gui/gui-filter.c
index 53070f068..6919ffc56 100644
--- a/src/gui/gui-filter.c
+++ b/src/gui/gui-filter.c
@@ -43,6 +43,27 @@ int gui_filters_enabled = 1; /* filters enabled? */
/*
+ * gui_filter_line_has_tag_no_filter: return 1 if line has tag "no_filter",
+ * which means that line should never
+ * been filtered (always displayed)
+ */
+
+int
+gui_filter_line_has_tag_no_filter (struct t_gui_line *line)
+{
+ int i;
+
+ for (i = 0; i < line->tags_count; i++)
+ {
+ if (strcmp (line->tags_array[i], GUI_FILTER_TAG_NO_FILTER) == 0)
+ return 1;
+ }
+
+ /* tag not found, line may be filtered */
+ return 0;
+}
+
+/*
* gui_filter_check_line: return 1 if a line should be displayed, or
* 0 if line is hidden (tag or regex found)
*/
@@ -52,13 +73,13 @@ gui_filter_check_line (struct t_gui_buffer *buffer, struct t_gui_line *line)
{
struct t_gui_filter *ptr_filter;
- /* make C compiler happy */
- (void) buffer;
-
/* line is always displayed if filters are disabled */
if (!gui_filters_enabled)
return 1;
+ if (gui_filter_line_has_tag_no_filter (line))
+ return 1;
+
for (ptr_filter = gui_filters; ptr_filter;
ptr_filter = ptr_filter->next_filter)
{
diff --git a/src/gui/gui-filter.h b/src/gui/gui-filter.h
index 93c3184fb..9daa65b4a 100644
--- a/src/gui/gui-filter.h
+++ b/src/gui/gui-filter.h
@@ -22,6 +22,8 @@
#include <regex.h>
+#define GUI_FILTER_TAG_NO_FILTER "no_filter"
+
/* filter structures */
struct t_gui_line;