From 357a505dc48f755e9b5963c34b88b4ce50a053ed Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Sun, 7 Mar 2010 13:20:16 +0100 Subject: [PATCH] make no_buffers a lua setting --- src/common.cc | 4 ++-- src/common.h | 3 ++- src/conky.cc | 7 ------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/common.cc b/src/common.cc index b6efb17d..146fb2b2 100644 --- a/src/common.cc +++ b/src/common.cc @@ -373,7 +373,7 @@ static void *run_update_callback(void *data) } } -extern int no_buffers; +conky::simple_config_setting no_buffers("no_buffers", true, false); void update_stuff(void) { @@ -407,7 +407,7 @@ void update_stuff(void) sem_wait(&uc->end_wait); /* XXX: move the following into the update_meminfo() functions? */ - if (no_buffers) { + if (no_buffers.get(*state)) { info.mem -= info.bufmem; info.memeasyfree += info.bufmem; } diff --git a/src/common.h b/src/common.h index dbae80cb..e75bcb3e 100644 --- a/src/common.h +++ b/src/common.h @@ -32,6 +32,7 @@ #include #include #include "text_object.h" +#include "setting.hh" void print_to_bytes(struct text_object *, char *, int); @@ -75,7 +76,7 @@ int round_to_int_temp(float); unsigned int round_to_int(float); -extern int no_buffers; +extern conky::simple_config_setting no_buffers; int open_acpi_temperature(const char *name); double get_acpi_temperature(int fd); diff --git a/src/conky.cc b/src/conky.cc index 3b0440b5..76cde498 100644 --- a/src/conky.cc +++ b/src/conky.cc @@ -392,9 +392,6 @@ unsigned int text_buffer_size = DEFAULT_TEXT_BUFFER_SIZE; /* UTF-8 */ bool utf8_mode = false; -/* no buffers in used memory? */ -int no_buffers; - /* pad percentages to decimals? */ static int pad_percents = 0; @@ -2585,7 +2582,6 @@ static void set_default_configurations(void) } } - no_buffers = 1; set_update_interval(3); update_interval_bat = NOBATTERY; info.music_player_interval = 1.0; @@ -3115,9 +3111,6 @@ char load_config_file(const char *f) } } #endif /* BUILD_X11 */ - CONF("no_buffers") { - no_buffers = string_to_bool(value); - } #ifdef __linux__ CONF("top_name_width") { if (set_top_name_width(value))