1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-24 07:02:30 +01:00

Info panel: Shorten memory line and simplify code a bit

With the fonts I use here, the memory information line in the "Info panel"
did not fit inside the window. So make that line a bit shorter by displaying

	Total memory allocated: 2600 kB (in use: 2182 kB)

instead of

	Total allocated memory: 2600 kB. Total memory in use: 2182 kB.

Furthermore, the surrounding code was a bit convoluted to display either

"Additional support for: WMSPEC"

or

"Additional support for: WMSPEC and MW"

As WMSPEC is always present and it doesn't seem we are adding more stuff
to support, one can do the same with a shorter code which reads a little
bit better.
This commit is contained in:
Carlos R. Mafra
2012-01-22 18:04:47 +00:00
parent cbe2f4e61a
commit 3bc48f0893

View File

@@ -1230,7 +1230,7 @@ void wShowInfoPanel(WScreen * scr)
{
struct mallinfo ma = mallinfo();
snprintf(buffer, sizeof(buffer),
_("Total allocated memory: %i kB. Total memory in use: %i kB.\n"),
_("Total memory allocated: %i kB (in use: %i kB).\n"),
(ma.arena + ma.hblkhd) / 1024, (ma.uordblks + ma.hblkhd) / 1024);
strbuf = wstrappend(strbuf, buffer);
@@ -1244,30 +1244,11 @@ void wShowInfoPanel(WScreen * scr)
strbuf = wstrappend(strbuf, " ");
}
strbuf = wstrappend(strbuf, _("\nAdditional support for: "));
{
char *list[9];
char buf[80];
int j = 0;
list[j++] = "WMSPEC";
strbuf = wstrappend(strbuf, _("\nAdditional support for: WMSPEC"));
#ifdef MWM_HINTS
list[j++] = "MWM";
strbuf = wstrappend(strbuf, " and MWM");
#endif
buf[0] = 0;
for (i = 0; i < j; i++) {
if (i > 0) {
if (i == j - 1)
strcat(buf, _(" and "));
else
strcat(buf, ", ");
}
strcat(buf, list[i]);
}
strbuf = wstrappend(strbuf, buf);
}
#ifdef XINERAMA
strbuf = wstrappend(strbuf, _("\n"));
#ifdef SOLARIS_XINERAMA