diff options
-rw-r--r-- | libLumina/LuminaOS-DragonFly.cpp | 6 | ||||
-rw-r--r-- | libLumina/LuminaOS-FreeBSD.cpp | 8 | ||||
-rw-r--r-- | libLumina/LuminaOS-Linux.cpp | 6 |
3 files changed, 16 insertions, 4 deletions
diff --git a/libLumina/LuminaOS-DragonFly.cpp b/libLumina/LuminaOS-DragonFly.cpp index 5fdd5e04..2e4ae358 100644 --- a/libLumina/LuminaOS-DragonFly.cpp +++ b/libLumina/LuminaOS-DragonFly.cpp @@ -178,6 +178,10 @@ QStringList LOS::Checksums(QStringList filepaths){ //Return: checksum of the inp //file system capacity QString LOS::FileSystemCapacity(QString dir) { //Return: percentage capacity as give by the df command - return QString; + QStringList mountInfo = LUtils::getCmdOutput("df " + dir); + QString::SectionFlag skipEmpty = QString::SectionSkipEmpty; + //we take the 5th word on the 2 line + QString capacity = mountInfo[1].section(" ",4,4, skipEmpty); + return capacity; } #endif diff --git a/libLumina/LuminaOS-FreeBSD.cpp b/libLumina/LuminaOS-FreeBSD.cpp index c855d7a0..dfc413b4 100644 --- a/libLumina/LuminaOS-FreeBSD.cpp +++ b/libLumina/LuminaOS-FreeBSD.cpp @@ -198,6 +198,10 @@ QStringList LOS::Checksums(QStringList filepaths){ //Return: checksum of the inp //file system capacity QString LOS::FileSystemCapacity(QString dir) { //Return: percentage capacity as give by the df command - return QString; -} + QStringList mountInfo = LUtils::getCmdOutput("df " + dir); + QString::SectionFlag skipEmpty = QString::SectionSkipEmpty; + //we take the 5th word on the 2 line + QString capacity = mountInfo[1].section(" ",4,4, skipEmpty); + return capacity; + #endif diff --git a/libLumina/LuminaOS-Linux.cpp b/libLumina/LuminaOS-Linux.cpp index ab88b5d8..ecf0adeb 100644 --- a/libLumina/LuminaOS-Linux.cpp +++ b/libLumina/LuminaOS-Linux.cpp @@ -197,6 +197,10 @@ QStringList LOS::Checksums(QStringList filepaths){ //Return: checksum of the inp //file system capacity QString LOS::FileSystemCapacity(QString dir) { //Return: percentage capacity as give by the df command - return QString; + QStringList mountInfo = LUtils::getCmdOutput("df " + dir); + QString::SectionFlag skipEmpty = QString::SectionSkipEmpty; + //we take the 5th word on the 2 line + QString capacity = mountInfo[1].section(" ",4,4, skipEmpty); + return capacity; } #endif |