mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 17:01:15 +02:00
yaft: remove unnecessary lines_available variable
This commit is contained in:
@@ -46,7 +46,6 @@ void YaFT_p::tab(void)
|
||||
void YaFT_p::nl(void)
|
||||
{
|
||||
txt.push("");
|
||||
lines_available++;
|
||||
move_cursor(1, 0);
|
||||
}
|
||||
|
||||
|
@@ -175,7 +175,7 @@ int YaFT::run(void)
|
||||
if (FD_ISSET(term->fd, &fds)) {
|
||||
while ((size = read(term->fd, buf, BUFSIZE)) > 0) {
|
||||
term->parse(buf, size);
|
||||
while (term->lines_available > 0) {
|
||||
while (term->txt.size() > 1) {
|
||||
std::string s = term->txt.front();
|
||||
OnShellOutputLoop(&s, res, &ok);
|
||||
#if 0
|
||||
@@ -184,9 +184,8 @@ int YaFT::run(void)
|
||||
else
|
||||
printf("[CTermWindow] [%s:%d] res=NULL ok=%d\n", __func__, __LINE__, ok);
|
||||
#endif
|
||||
// fprintf(stderr, "%d %s\n", term.lines_available, term.txt.front().c_str());
|
||||
// fprintf(stderr, "size %d '%s'\n", term->txt.size(), s.c_str());
|
||||
term->txt.pop();
|
||||
term->lines_available--;
|
||||
}
|
||||
if (! paint)
|
||||
continue;
|
||||
|
@@ -85,7 +85,6 @@ extern std::string ttx_font_file;
|
||||
* a command but don't display anything */
|
||||
YaFT_p::YaFT_p(bool Paint)
|
||||
{
|
||||
lines_available = 0;
|
||||
txt.push("");
|
||||
nlseen = false;
|
||||
paint = Paint;
|
||||
@@ -232,10 +231,8 @@ void YaFT_p::move_cursor(int y_offset, int x_offset)
|
||||
}
|
||||
cursor.y = y;
|
||||
|
||||
if (y_offset > 0 && !nlseen) {
|
||||
if (y_offset > 0 && !nlseen)
|
||||
txt.push("");
|
||||
lines_available++;
|
||||
}
|
||||
}
|
||||
|
||||
/* absolute movement: never scroll */
|
||||
@@ -255,10 +252,8 @@ void YaFT_p::set_cursor(int y, int x)
|
||||
x = (x < 0) ? 0: (x >= cols) ? cols - 1: x;
|
||||
y = (y < top) ? top: (y > bottom) ? bottom: y;
|
||||
|
||||
if (cursor.y != y && !nlseen) {
|
||||
if (cursor.y != y && !nlseen)
|
||||
txt.push("");
|
||||
lines_available++;
|
||||
}
|
||||
|
||||
cursor.x = x;
|
||||
cursor.y = y;
|
||||
|
@@ -179,7 +179,6 @@ class YaFT_p
|
||||
int cols, lines; /* terminal size (cell) */
|
||||
time_t last_paint;
|
||||
std::queue<std::string> txt; /* contains "sanitized" (without control chars) output text */
|
||||
int lines_available; /* lines available in txt */
|
||||
|
||||
YaFT_p(bool paint = true);
|
||||
~YaFT_p();
|
||||
|
Reference in New Issue
Block a user