diff options
author | Christopher Roy Bratusek <nano@jpberlin.de> | 2015-03-26 21:30:24 +0100 |
---|---|---|
committer | Christopher Roy Bratusek <nano@jpberlin.de> | 2015-03-26 21:30:24 +0100 |
commit | 3eb696e135f213359ae7439d1d2565d0a7c437cc (patch) | |
tree | a851e9d1fccaa8a5ae3061fa58238b5f4df068b7 /libLumina/LuminaOS-Debian.cpp | |
parent | Merge pull request #77 from william-os4y/fmNumbers (diff) | |
download | lumina-3eb696e135f213359ae7439d1d2565d0a7c437cc.tar.gz lumina-3eb696e135f213359ae7439d1d2565d0a7c437cc.tar.bz2 lumina-3eb696e135f213359ae7439d1d2565d0a7c437cc.zip |
- updated debian/changelog
- checksums for LuminaOS-Debian and LuminaOS-Linux
- capacity for LuminaOS-Debian
Diffstat (limited to 'libLumina/LuminaOS-Debian.cpp')
-rw-r--r-- | libLumina/LuminaOS-Debian.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libLumina/LuminaOS-Debian.cpp b/libLumina/LuminaOS-Debian.cpp index aad65ece..f1048347 100644 --- a/libLumina/LuminaOS-Debian.cpp +++ b/libLumina/LuminaOS-Debian.cpp @@ -195,12 +195,25 @@ int LOS::batterySecondsLeft(){ //Returns: estimated number of seconds remaining //File Checksums QStringList LOS::Checksums(QStringList filepaths){ //Return: checksum of the input file - return QStringList(); + QStringList info = LUtils::getCmdOutput("md5sum \""+filepaths.join("\" \"")+"\""); + for(int i=0; i<info.length(); i++){ + // first: md5sum: = error ; second: there's always one empty entry generated by getCmdOutput + if( info[i].startsWith("md5sum:") || info[i].isEmpty()){ info.removeAt(i); i--; } + else{ + //Strip out the extra information + info[i] = info[i].section(" ",0,0); + } + } + return info; } //file system capacity QString LOS::FileSystemCapacity(QString dir) { //Return: percentage capacity as give by the df command - return QString; + QStringList mountInfo = LUtils::getCmdOutput("df -h " + dir); + QString::SectionFlag skipEmpty = QString::SectionSkipEmpty; + //output: 200G of 400G available on /mount/point + QString capacity = mountInfo[1].section(" ",3,3, skipEmpty) + " of " + mountInfo[1].section(" ",1,1, skipEmpty) + " available on " + mountInfo[1].section(" ",5,5, skipEmpty); + return capacity; } #endif |