Merge Irssi 0.8.16-rc1
[silc.git] / apps / irssi / src / core / write-buffer.c
index 1c3eef824b4a54ebca451ae99ec71d00a71e9e5b..6f6eef8abb471b690f5f17106d1021d70611952d 100644 (file)
@@ -13,9 +13,9 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
 #include "module.h"
@@ -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);