From 9e713e54f18c34943fbbb61e8a8b35be97296cf7 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sat, 11 Jul 2015 16:08:15 +0200 Subject: update LOS::MemoryUsagePercent() for output format change in latest version of 'top' in Debian --- debian/changelog | 8 ++++++++ libLumina/LuminaOS-Debian.cpp | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index bf62959c..a6be4039 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +lumina-deskopt (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 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..aad0e456 100644 --- a/libLumina/LuminaOS-Debian.cpp +++ b/libLumina/LuminaOS-Debian.cpp @@ -266,8 +266,8 @@ int LOS::MemoryUsagePercent(){ 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); } -- cgit From 07bbe91cc42b85a4da0d862108314e2e3d8edf3e Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sat, 11 Jul 2015 16:08:42 +0200 Subject: typo fix --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a6be4039..02b4029a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -lumina-deskopt (0.8.5.754-1nano) unstable; urgency=low +lumina-desktop (0.8.5.754-1nano) unstable; urgency=low * New git snapshot - update LOS::MemoryUsagePercent() for output format -- cgit From c807fb56592b716b4bebc90d8d7e0b293cd6c8c1 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sat, 11 Jul 2015 20:22:57 +0200 Subject: fix filter critera for Debian's top --- libLumina/LuminaOS-Debian.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libLumina/LuminaOS-Debian.cpp b/libLumina/LuminaOS-Debian.cpp index aad0e456..85dd657e 100644 --- a/libLumina/LuminaOS-Debian.cpp +++ b/libLumina/LuminaOS-Debian.cpp @@ -262,7 +262,7 @@ 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 -- cgit