~ubuntu-branches/ubuntu/oneiric/irssi/oneiric

« back to all changes in this revision

Viewing changes to src/fe-text/lastlog.c

  • Committer: Bazaar Package Importer
  • Author(s): Christian Bjälevik
  • Date: 2007-04-28 02:52:01 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070428025201-2c4swxnpn4wr7fpg
Tags: 0.8.11-0ubuntu1
* New upstream release:
  - http://www.irssi.org/news/ChangeLog
* debian/{control,compat}:
  - Bump Standards.
* debian/patches/00list:
  - Disable 05upgrade-check-binary.patch, applied upstream.
  - Disable 08doublefree.patch, applied upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
#define DEFAULT_LASTLOG_AFTER 3
36
36
#define MAX_LINES_WITHOUT_FORCE 1000
37
37
 
38
 
static void window_lastlog_clear(WINDOW_REC *window)
39
 
{
40
 
        TEXT_BUFFER_VIEW_REC *view;
41
 
        LINE_REC *line, *next;
42
 
 
43
 
        term_refresh_freeze();
44
 
        view = WINDOW_GUI(window)->view;
45
 
        line = textbuffer_view_get_lines(view);
46
 
 
47
 
        while (line != NULL) {
48
 
                next = line->next;
49
 
 
50
 
                if (line->info.level & MSGLEVEL_LASTLOG)
51
 
                        textbuffer_view_remove_line(view, line);
52
 
                line = next;
53
 
        }
54
 
        textbuffer_view_redraw(view);
55
 
        term_refresh_thaw();
56
 
}
57
 
 
58
38
/* Only unknown keys in `optlist' should be levels.
59
39
   Returns -1 if unknown option was given. */
60
40
int cmd_options_get_level(const char *cmd, GHashTable *optlist)
109
89
        if (level == 0) level = MSGLEVEL_ALL;
110
90
 
111
91
        if (g_hash_table_lookup(optlist, "clear") != NULL) {
112
 
                window_lastlog_clear(active_win);
 
92
                textbuffer_view_remove_lines_by_level(WINDOW_GUI(active_win)->view, MSGLEVEL_LASTLOG);
113
93
                if (*searchtext == '\0')
114
94
                        return;
115
95
        }