mirror of
https://github.com/irssi/irssi.git
synced 2026-08-13 13:42:13 +02:00
Autosaving settings and autoflushing write buffer might have stopped from
working sometimes because of missing "return 1". git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2325 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
d6abc84ab5
commit
bba5603903
2 changed files with 18 additions and 8 deletions
|
|
@ -126,13 +126,16 @@ void write_buffer_flush(void)
|
|||
block_count = 0;
|
||||
}
|
||||
|
||||
static int flush_timeout(void)
|
||||
{
|
||||
write_buffer_flush();
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void read_settings(void)
|
||||
{
|
||||
int msecs;
|
||||
|
||||
if (timeout_tag != -1)
|
||||
g_source_remove(timeout_tag);
|
||||
|
||||
write_buffer_flush();
|
||||
|
||||
write_buffer_max_blocks = settings_get_int("write_buffer_kb") *
|
||||
|
|
@ -140,9 +143,14 @@ static void read_settings(void)
|
|||
|
||||
if (settings_get_int("write_buffer_mins") > 0) {
|
||||
msecs = settings_get_int("write_buffer_mins")*60*1000;
|
||||
timeout_tag = g_timeout_add(msecs,
|
||||
(GSourceFunc) write_buffer_flush,
|
||||
NULL);
|
||||
if (timeout_tag == -1) {
|
||||
timeout_tag = g_timeout_add(msecs,
|
||||
(GSourceFunc) flush_timeout,
|
||||
NULL);
|
||||
}
|
||||
} else if (timeout_tag != -1) {
|
||||
g_source_remove(timeout_tag);
|
||||
timeout_tag = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue