diff options
author | Ken Moore <moorekou@gmail.com> | 2015-07-13 07:59:49 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-07-13 07:59:49 -0400 |
commit | 8b5afbf1af5bdd1e9c0fabc2ae5ffbd44cba1fd7 (patch) | |
tree | ba75d47450edbd1f32cd76953d213076a5b3a76d | |
parent | Final cleanup of debugging messages and temporary changes prior to release. A... (diff) | |
parent | fix filter critera for Debian's top (diff) | |
download | lumina-8b5afbf1af5bdd1e9c0fabc2ae5ffbd44cba1fd7.tar.gz lumina-8b5afbf1af5bdd1e9c0fabc2ae5ffbd44cba1fd7.tar.bz2 lumina-8b5afbf1af5bdd1e9c0fabc2ae5ffbd44cba1fd7.zip |
Merge pull request #135 from Nanolx/master
Update LOS::MemoryUsagePercent()
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | libLumina/LuminaOS-Debian.cpp | 6 |
2 files changed, 11 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog index bf62959c..02b4029a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +lumina-desktop (0.8.5.754-1nano) unstable; urgency=low + + * New git snapshot + - update LOS::MemoryUsagePercent() for output format + change in latest version of 'top' in Debian + + -- Christopher Roy Bratusek <nano@jpberlin.de> Sat, 11 Jul 2015 16:07:42 +0200 + lumina-desktop (0.8.5.697-1nano) unstable; urgency=low * New git snapshot diff --git a/libLumina/LuminaOS-Debian.cpp b/libLumina/LuminaOS-Debian.cpp index 12d8f11e..85dd657e 100644 --- a/libLumina/LuminaOS-Debian.cpp +++ b/libLumina/LuminaOS-Debian.cpp @@ -262,12 +262,12 @@ int LOS::CPUUsagePercent(){ //Returns: Overall percentage of the amount of CPU c } int LOS::MemoryUsagePercent(){ - QStringList mem = LUtils::getCmdOutput("top -bn1").filter("Mem:"); + QStringList mem = LUtils::getCmdOutput("top -bn1").filter("Mem :"); if(mem.isEmpty()){ return -1; } double fB = 0; //Free Bytes double uB = 0; //Used Bytes - fB = mem.first().section(" ", 6, 6, QString::SectionSkipEmpty).toDouble(); - uB = mem.first().section(" ", 4, 4, QString::SectionSkipEmpty).toDouble(); + fB = mem.first().section(" ", 5, 5, QString::SectionSkipEmpty).toDouble(); + uB = mem.first().section(" ", 7, 7, QString::SectionSkipEmpty).toDouble(); double per = (uB/(fB+uB)) * 100.0; return qRound(per); } |