[gnome-system-monitor] Reworked cached information display
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-system-monitor] Reworked cached information display
- Date: Tue, 21 Jan 2020 10:31:45 +0000 (UTC)
commit 7f4f6781bc07aae8cffeae77831e44661960e95b
Author: Robert Roth <robert roth off gmail com>
Date: Tue Jan 21 12:31:37 2020 +0200
Reworked cached information display
src/load-graph.cpp | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/load-graph.cpp b/src/load-graph.cpp
index d147f773..8d79f985 100644
--- a/src/load-graph.cpp
+++ b/src/load-graph.cpp
@@ -404,6 +404,7 @@ namespace
{
char* used_text;
char* cached_text;
+ char* cached_label;
char* total_text;
char* text;
@@ -414,14 +415,17 @@ namespace
text = g_strdup(_("not available"));
} else {
// xgettext: 540MiB (53 %) of 1.0 GiB
- if (cached == 0) {
- text = g_strdup_printf(_("%s (%.1f%%) of %s"), used_text, 100.0 * percent, total_text);
- } else {
- text = g_strdup_printf(_("%s (%.1f%%) of %s\nCache: %s"), used_text, 100.0 * percent,
total_text, cached_text);
+ text = g_strdup_printf(_("%s (%.1f%%) of %s"), used_text, 100.0 * percent, total_text);
+
+ if (cached != 0) {
+ cached_label = g_strdup_printf(_("Cache %s"), cached_text);
+ text = g_strdup_printf("%s\n%s", text, cached_label);
+ g_free (cached_label);
}
}
gtk_label_set_text(label, text);
g_free(used_text);
+ g_free(cached_text);
g_free(total_text);
g_free(text);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]