mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 12:23:37 +02:00
Added time, size and level setting types. Breaks some settings - I'll add
automatic converter to these settings later. Meanwhile you CVS users can fix your config files yourself :) Time settings allow using "days", "hours", "minutes", "seconds" and "milliseconds" or several of their abbreviations. For example "5d 4h 5msecs". Size settings allow using "gbytes", "mbytes", "kbytes" and "bytes" or their abbrevations. For example "5MB". Level settings are currently handled pretty much the way they were before. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3080 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
9c18cb00e7
commit
bd6fe052bc
35 changed files with 526 additions and 186 deletions
|
|
@ -134,17 +134,14 @@ static int flush_timeout(void)
|
|||
|
||||
static void read_settings(void)
|
||||
{
|
||||
int msecs;
|
||||
|
||||
write_buffer_flush();
|
||||
|
||||
write_buffer_max_blocks = settings_get_int("write_buffer_kb") *
|
||||
1024/BUFFER_BLOCK_SIZE;
|
||||
write_buffer_max_blocks =
|
||||
settings_get_size("write_buffer_size") / BUFFER_BLOCK_SIZE;
|
||||
|
||||
if (settings_get_int("write_buffer_mins") > 0) {
|
||||
msecs = settings_get_int("write_buffer_mins")*60*1000;
|
||||
if (settings_get_time("write_buffer_timeout") > 0) {
|
||||
if (timeout_tag == -1) {
|
||||
timeout_tag = g_timeout_add(msecs,
|
||||
timeout_tag = g_timeout_add(settings_get_time("write_buffer_timeout"),
|
||||
(GSourceFunc) flush_timeout,
|
||||
NULL);
|
||||
}
|
||||
|
|
@ -161,8 +158,8 @@ static void cmd_flushbuffer(void)
|
|||
|
||||
void write_buffer_init(void)
|
||||
{
|
||||
settings_add_int("misc", "write_buffer_mins", 0);
|
||||
settings_add_int("misc", "write_buffer_kb", 0);
|
||||
settings_add_time("misc", "write_buffer_timeout", "0");
|
||||
settings_add_size("misc", "write_buffer_size", "0");
|
||||
|
||||
buffers = g_hash_table_new((GHashFunc) g_direct_hash,
|
||||
(GCompareFunc) g_direct_equal);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue