From 134e0c278f91b47364e75ab7824e085069fee600 Mon Sep 17 00:00:00 2001 From: Harald Judt Date: Sun, 7 Dec 2014 13:37:53 +0100 Subject: [PATCH] Use g_format_size_full with G_FORMAT_SIZE_IEC_UNITS for RAM This makes it more consistent with what other tools report. --- src/main.c | 8 ++++---- src/task-manager.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.c b/src/main.c index f9645c8..10fbe9b 100644 --- a/src/main.c +++ b/src/main.c @@ -98,14 +98,14 @@ init_timeout (void) g_object_get (settings, "show-memory-in-xbytes", &show_memory_in_xbytes, NULL); if (show_memory_in_xbytes) { - used = g_format_size(memory_used); - total = g_format_size(memory_total); + used = g_format_size_full(memory_used, G_FORMAT_SIZE_IEC_UNITS); + total = g_format_size_full(memory_total, G_FORMAT_SIZE_IEC_UNITS); g_snprintf (memory_info, 64,"%s / %s", used, total); g_free(used); g_free(total); - used = g_format_size(swap_used); - total = g_format_size(swap_total); + used = g_format_size_full(swap_used, G_FORMAT_SIZE_IEC_UNITS); + total = g_format_size_full(swap_total, G_FORMAT_SIZE_IEC_UNITS); g_snprintf (swap_info, 64,"%s / %s", used, total); g_free(used); g_free(total); diff --git a/src/task-manager.c b/src/task-manager.c index 32fe28a..4d689df 100644 --- a/src/task-manager.c +++ b/src/task-manager.c @@ -234,8 +234,8 @@ model_update_tree_iter (GtkTreeModel *model, GtkTreeIter *iter, Task *task) GdkPixbuf *icon; #endif - vsz = g_format_size (task->vsz); - rss = g_format_size (task->rss); + vsz = g_format_size_full (task->vsz, G_FORMAT_SIZE_IEC_UNITS); + rss = g_format_size_full (task->rss, G_FORMAT_SIZE_IEC_UNITS); g_snprintf (value, 14, (more_precision) ? "%.2f" : "%.0f", task->cpu_user + task->cpu_system); g_snprintf (cpu, 16, _("%s%%"), value);