summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--superkaramba/src/memsensor.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/superkaramba/src/memsensor.cpp b/superkaramba/src/memsensor.cpp
index 1d6c4dc..8da5d58 100644
--- a/superkaramba/src/memsensor.cpp
+++ b/superkaramba/src/memsensor.cpp
@@ -319,17 +319,24 @@ void MemSensor::update()
format = "%um";
}
- format.replace( TQRegExp("%fmb", false), TQString::number( (int)(( totalMem - usedMemNoBuffers)/1024.0+0.5)));
- format.replace( TQRegExp("%fm", false), TQString::number( (int)( ( totalMem - usedMem )/1024.0+0.5) ));
+ format.replace( TQRegExp("%fmbp", false), TQString::number( (int)((totalMem - usedMemNoBuffers) * 100.0 / totalMem) ));
+ format.replace( TQRegExp("%fmb", false), TQString::number( (int)((totalMem - usedMemNoBuffers) / 1024.0 + 0.5) ));
+ format.replace( TQRegExp("%fmp", false), TQString::number( (int)((totalMem - usedMem) * 100.0 / totalMem) ));
+ format.replace( TQRegExp("%fm", false), TQString::number( (int)((totalMem - usedMem) / 1024.0 + 0.5) ));
- format.replace( TQRegExp("%umb", false), TQString::number( (int)((usedMemNoBuffers)/1024.0+0.5)));
- format.replace( TQRegExp("%um", false), TQString::number( (int)((usedMem)/1024.0+0.5 )));
+ format.replace( TQRegExp("%umbp", false), TQString::number( (int)(usedMemNoBuffers * 100.0 / totalMem) ));
+ format.replace( TQRegExp("%umb", false), TQString::number( (int)(usedMemNoBuffers / 1024.0 + 0.5) ));
+ format.replace( TQRegExp("%ump", false), TQString::number( (int)(usedMem * 100.0 / totalMem) ));
+ format.replace( TQRegExp("%um", false), TQString::number( (int)(usedMem / 1024.0 + 0.5) ));
- format.replace( TQRegExp("%tm", false), TQString::number( (int)( (totalMem)/1024.0+0.5)));
+ format.replace( TQRegExp("%tm", false), TQString::number( (int)(totalMem / 1024.0 + 0.5) ));
- format.replace( TQRegExp("%fs", false), TQString::number( (int)((totalSwap - usedSwap)/1024.0+0.5)));
- format.replace( TQRegExp("%us", false), TQString::number( (int)(usedSwap/1024.0+0.5)));
- format.replace( TQRegExp("%ts", false), TQString::number( (int)(totalSwap/1024.0+0.5)));
+ format.replace( TQRegExp("%fsp", false), TQString::number( (int)((totalSwap - usedSwap) * 100.0 / totalSwap) ));
+ format.replace( TQRegExp("%fs", false), TQString::number( (int)((totalSwap - usedSwap) / 1024.0 + 0.5) ));
+ format.replace( TQRegExp("%usp", false), TQString::number( (int)(usedSwap * 100.0 / totalSwap) ));
+ format.replace( TQRegExp("%us", false), TQString::number( (int)(usedSwap / 1024.0 + 0.5) ));
+
+ format.replace( TQRegExp("%ts", false), TQString::number( (int)(totalSwap / 1024.0 + 0.5) ));
meter->setValue(format);
++it;