diff options
Diffstat (limited to 'libLumina')
-rw-r--r-- | libLumina/LuminaOS-FreeBSD.cpp | 6 | ||||
-rw-r--r-- | libLumina/LuminaUtils.cpp | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/libLumina/LuminaOS-FreeBSD.cpp b/libLumina/LuminaOS-FreeBSD.cpp index 3bf857d9..290ddc11 100644 --- a/libLumina/LuminaOS-FreeBSD.cpp +++ b/libLumina/LuminaOS-FreeBSD.cpp @@ -297,7 +297,11 @@ int LOS::MemoryUsagePercent(){ if(mem[i].contains("Inact") || mem[i].contains("Free")){ fB = fB+LUtils::DisplaySizeToBytes(mem[i].section(" ",0,0)); } else{ uB = uB+LUtils::DisplaySizeToBytes(mem[i].section(" ",0,0)); } } - return qRound( (uB/(fB+uB)) * 100.0); + qDebug() << "Memory Calc:" << mem; + qDebug() << " - Bytes:" << "U:"<<uB<<"F:"<< fB<<"T:"<< (uB+fB); + double per = (uB/(fB+uB)) * 100.0; + qDebug() << " - Percentage:" << per; + return qRound(per); } #endif diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp index 8eee76ca..c9b13b8a 100644 --- a/libLumina/LuminaUtils.cpp +++ b/libLumina/LuminaUtils.cpp @@ -145,6 +145,7 @@ void LUtils::LoadTranslation(QApplication *app, QString appname){ } double LUtils::DisplaySizeToBytes(QString num){ + //qDebug() << "Convert Num to Bytes:" << num; num = num.toLower().simplified(); num = num.remove(" "); if(num.isEmpty()){ return 0.0; } @@ -159,6 +160,7 @@ double LUtils::DisplaySizeToBytes(QString num){ if(lab==labs[i]){ break; }//already at the right units - break out N = N*1024.0; //Move to the next unit of measurement } + //qDebug() << " - Done:" << QString::number(N) << lab << num; return N; } |