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