diff -ur kdebase-3.5.6.orig/kcontrol/info/memory.cpp kdebase-3.5.6/kcontrol/info/memory.cpp --- kdebase-3.5.6.orig/kcontrol/info/memory.cpp 2005-10-10 17:03:43.000000000 +0200 +++ kdebase-3.5.6/kcontrol/info/memory.cpp 2007-04-22 19:51:24.000000000 +0200 @@ -153,10 +153,10 @@ break; case SWAP_MEM: vbox->addSpacing(SPACING); - title = i18n("Total swap memory:"); + title = i18n("Total swap space:"); break; case FREESWAP_MEM: - title = i18n("Free swap memory:"); + title = i18n("Free swap space:"); break; default: title = ""; @@ -197,27 +197,26 @@ case MEM_RAM_AND_HDD: title = i18n("Total Memory"); hint = i18n("This graph gives you an overview of the " - "total sum of physical and virtual memory " - "in your system."); + "usage of all available memory (the sum of " + "physical memory and swap space) in your system."); break; case MEM_RAM: title = i18n("Physical Memory"); hint = i18n("This graph gives you an overview of " - "the usage of physical memory in your system." + "the usage of physical memory in your system." "

Most operating systems (including Linux) " "will use as much of the available physical " - "memory as possible as disk cache, " - "to speed up the system performance. " - "

This means that if you have a small amount " + "memory as possible for a disk cache, " + "to speed up the reading and writing of files. " + "

This means that if you are seeing a small amount " "of Free Physical Memory and a large amount of " - "Disk Cache Memory, your system is well " - "configured."); + "Disk Cache, your system is well configured."); break; case MEM_HDD: title = i18n("Swap Space"); - hint = i18n("The swap space is the virtual memory " + hint = i18n("Swap space is the virtual memory " "available to the system. " - "

It will be used on demand and is provided " + "

It will be used when needed, and is provided " "through one or more swap partitions and/or swap files."); break; default: @@ -312,10 +311,10 @@ last_used = *used; #ifdef HAVE_LONG_LONG - percent = (((long long)last_used) * 100) / total; + percent = (((long long)last_used) * 1000 + 5) / (total * 10); #else /* prevent integer overflow with usage of double type */ - percent = (int) ((((double)last_used) * 100) / total); + percent = (int) ((((double)last_used) * 1000 + 5) / (total * 10)); #endif if (count) @@ -400,11 +399,11 @@ if (!ram_colors_initialized) { ram_colors_initialized = true; ram_text[0] = i18n("Application Data"); - ram_colors[0] = COLOR_USED_MEMORY; /* used+shared */ + ram_colors[0] = COLOR_USED_DATA; /* used+shared */ ram_text[1] = i18n("Disk Buffers"); - ram_colors[1] = QColor(24,131,5); /* buffer */ + ram_colors[1] = COLOR_USED_BUFFER; /* buffers */ ram_text[2] = i18n("Disk Cache"); - ram_colors[2] = QColor(33,180,7); /* cached */ + ram_colors[2] = COLOR_USED_CACHE; /* cached */ ram_text[3] = i18n("Free Physical Memory"); ram_colors[3] = COLOR_FREE_MEMORY; /* free */ } @@ -425,24 +424,20 @@ used, swap_colors, swap_text); /* RAM + SWAP usage: */ - if (Memory_Info[SWAP_MEM] == NO_MEMORY_INFO || - Memory_Info[FREESWAP_MEM] == NO_MEMORY_INFO) - Memory_Info[SWAP_MEM] = Memory_Info[FREESWAP_MEM] = 0; - - used[1] = Memory_Info[SWAP_MEM] - Memory_Info[FREESWAP_MEM]; - used[2] = Memory_Info[FREE_MEM] + Memory_Info[FREESWAP_MEM]; - used[0] = (Memory_Info[TOTAL_MEM]+Memory_Info[SWAP_MEM])-used[1]-used[2]; + /* used[0] already contains the amount of used swap */ + used[2] = Memory_Info[FREE_MEM] + ZERO_IF_NO_INFO(Memory_Info[FREESWAP_MEM]); + used[1] = Memory_Info[TOTAL_MEM] - Memory_Info[FREE_MEM]; if (!all_colors_initialized) { all_colors_initialized = true; - all_text[0] = i18n("Used Physical Memory"); - all_colors[0] = COLOR_USED_MEMORY; /* used ram */ - all_text[1] = i18n("Used Swap"); - all_colors[1] = COLOR_USED_SWAP; /* used swap */ - all_text[2] = i18n("Total Free Memory"); + all_text[0] = i18n("Used Memory (swap part)"); + all_colors[0] = COLOR_USED_SWAP; /* used swap */ + all_text[1] = i18n("Used Memory (physical part)"); + all_colors[1] = COLOR_USED_RAM; /* used ram */ + all_text[2] = i18n("Free Memory (total)"); all_colors[2] = COLOR_FREE_MEMORY; /* free ram+swap*/ } Display_Graph(MEM_RAM_AND_HDD, 3, - ok1 ? Memory_Info[TOTAL_MEM] + Memory_Info[SWAP_MEM] + ok1 ? Memory_Info[TOTAL_MEM] + ZERO_IF_NO_INFO(Memory_Info[SWAP_MEM]) : NO_MEMORY_INFO, used, all_colors, all_text); } diff -ur kdebase-3.5.6.orig/kcontrol/info/memory.h kdebase-3.5.6/kcontrol/info/memory.h --- kdebase-3.5.6.orig/kcontrol/info/memory.h 2005-09-10 10:25:05.000000000 +0200 +++ kdebase-3.5.6/kcontrol/info/memory.h 2007-04-22 19:47:56.000000000 +0200 @@ -20,8 +20,11 @@ typedef unsigned long t_memsize; #endif -#define COLOR_USED_MEMORY QColor(255,0,0) -#define COLOR_USED_SWAP QColor(255,134,64) +#define COLOR_USED_SWAP QColor(255,0,0) +#define COLOR_USED_DATA QColor(255,180,88) +#define COLOR_USED_BUFFER QColor(184,200,0) +#define COLOR_USED_CACHE QColor(156,192,0) +#define COLOR_USED_RAM QColor(220,200,88) #define COLOR_FREE_MEMORY QColor(127,255,212) class KMemoryWidget:public KCModule {