summaryrefslogtreecommitdiff
path: root/src/fe-text/lastlog.c
diff options
context:
space:
mode:
authorEmanuele Giaquinta <exg@irssi.org>2007-02-17 15:31:10 +0000
committerexg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564>2007-02-17 15:31:10 +0000
commit541fa72f46a95ea506064a868f95d15f1a7cb8f4 (patch)
tree15be2ac5c09ed60df843c54b509c629e30f54426 /src/fe-text/lastlog.c
parent1a195da68510698bce5c525e07478f868cd5e5a1 (diff)
downloadirssi-541fa72f46a95ea506064a868f95d15f1a7cb8f4.zip
Generalize window_lastlog_clear in textbuffer_view_remove_lines_by_level.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4419 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text/lastlog.c')
-rw-r--r--src/fe-text/lastlog.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/fe-text/lastlog.c b/src/fe-text/lastlog.c
index 3919be7e..26fd1611 100644
--- a/src/fe-text/lastlog.c
+++ b/src/fe-text/lastlog.c
@@ -35,26 +35,6 @@
#define DEFAULT_LASTLOG_AFTER 3
#define MAX_LINES_WITHOUT_FORCE 1000
-static void window_lastlog_clear(WINDOW_REC *window)
-{
- TEXT_BUFFER_VIEW_REC *view;
- LINE_REC *line, *next;
-
- term_refresh_freeze();
- view = WINDOW_GUI(window)->view;
- line = textbuffer_view_get_lines(view);
-
- while (line != NULL) {
- next = line->next;
-
- if (line->info.level & MSGLEVEL_LASTLOG)
- textbuffer_view_remove_line(view, line);
- line = next;
- }
- textbuffer_view_redraw(view);
- term_refresh_thaw();
-}
-
/* Only unknown keys in `optlist' should be levels.
Returns -1 if unknown option was given. */
int cmd_options_get_level(const char *cmd, GHashTable *optlist)
@@ -109,7 +89,7 @@ static void show_lastlog(const char *searchtext, GHashTable *optlist,
if (level == 0) level = MSGLEVEL_ALL;
if (g_hash_table_lookup(optlist, "clear") != NULL) {
- window_lastlog_clear(active_win);
+ textbuffer_view_remove_lines_by_level(WINDOW_GUI(active_win)->view, MSGLEVEL_LASTLOG);
if (*searchtext == '\0')
return;
}