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 --- libLumina/LuminaOS-Debian.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libLumina/LuminaOS-Debian.cpp') 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