diff options
author | Ken Moore <ken@pcbsd.org> | 2015-03-26 15:40:44 -0400 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-03-26 15:40:44 -0400 |
commit | 58cc446a340fc9361b08372bad9c1ce9eaeaa19c (patch) | |
tree | c0ccb9a3d74a0909829d210428e9600c3c612a12 | |
parent | Clean up the retcode > 0 "or" usage in main.cpp (diff) | |
download | lumina-58cc446a340fc9361b08372bad9c1ce9eaeaa19c.tar.gz lumina-58cc446a340fc9361b08372bad9c1ce9eaeaa19c.tar.bz2 lumina-58cc446a340fc9361b08372bad9c1ce9eaeaa19c.zip |
Clean up the new filesystemusage functions a bit. Make sure that the directory is quoted within the command (could be spaces in the path).
-rw-r--r-- | libLumina/LuminaOS-Debian.cpp | 2 | ||||
-rw-r--r-- | libLumina/LuminaOS-DragonFly.cpp | 2 | ||||
-rw-r--r-- | libLumina/LuminaOS-FreeBSD.cpp | 3 | ||||
-rw-r--r-- | libLumina/LuminaOS-Linux.cpp | 2 | ||||
-rw-r--r-- | libLumina/LuminaOS-OpenBSD.cpp | 2 | ||||
-rw-r--r-- | libLumina/LuminaOS-kFreeBSD.cpp | 2 | ||||
-rw-r--r-- | libLumina/LuminaOS-template.cpp | 2 |
7 files changed, 8 insertions, 7 deletions
diff --git a/libLumina/LuminaOS-Debian.cpp b/libLumina/LuminaOS-Debian.cpp index aad65ece..b0da7586 100644 --- a/libLumina/LuminaOS-Debian.cpp +++ b/libLumina/LuminaOS-Debian.cpp @@ -200,7 +200,7 @@ 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; + return QString(); } #endif diff --git a/libLumina/LuminaOS-DragonFly.cpp b/libLumina/LuminaOS-DragonFly.cpp index 2e4ae358..b9ba58a2 100644 --- a/libLumina/LuminaOS-DragonFly.cpp +++ b/libLumina/LuminaOS-DragonFly.cpp @@ -178,7 +178,7 @@ 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 - QStringList mountInfo = LUtils::getCmdOutput("df " + dir); + 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); diff --git a/libLumina/LuminaOS-FreeBSD.cpp b/libLumina/LuminaOS-FreeBSD.cpp index dfc413b4..fc4135f0 100644 --- a/libLumina/LuminaOS-FreeBSD.cpp +++ b/libLumina/LuminaOS-FreeBSD.cpp @@ -198,10 +198,11 @@ 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 - QStringList mountInfo = LUtils::getCmdOutput("df " + dir); + 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 ecf0adeb..5a800cc5 100644 --- a/libLumina/LuminaOS-Linux.cpp +++ b/libLumina/LuminaOS-Linux.cpp @@ -197,7 +197,7 @@ 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 - QStringList mountInfo = LUtils::getCmdOutput("df " + dir); + 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); diff --git a/libLumina/LuminaOS-OpenBSD.cpp b/libLumina/LuminaOS-OpenBSD.cpp index dc8df0a7..df6ddeba 100644 --- a/libLumina/LuminaOS-OpenBSD.cpp +++ b/libLumina/LuminaOS-OpenBSD.cpp @@ -215,7 +215,7 @@ QString LOS::FileSystemCapacity(QString dir) { //>Filesystem 512-blocks Used Avail Capacity Mounted on //>/dev/sd2l 14334588 739900 12877960 5% /home - QStringList mountInfo = LUtils::getCmdOutput("df " + dir); + 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); diff --git a/libLumina/LuminaOS-kFreeBSD.cpp b/libLumina/LuminaOS-kFreeBSD.cpp index b0c98abb..2b24ce51 100644 --- a/libLumina/LuminaOS-kFreeBSD.cpp +++ b/libLumina/LuminaOS-kFreeBSD.cpp @@ -160,7 +160,7 @@ 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; + return QString(); } #endif diff --git a/libLumina/LuminaOS-template.cpp b/libLumina/LuminaOS-template.cpp index 38e54816..dfb9d850 100644 --- a/libLumina/LuminaOS-template.cpp +++ b/libLumina/LuminaOS-template.cpp @@ -108,7 +108,7 @@ 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; + return QString(); } #endif |