diff options
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | libLumina/LuminaOS-Debian.cpp | 17 | ||||
-rw-r--r-- | libLumina/LuminaOS-Linux.cpp | 11 |
3 files changed, 31 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog index a06b640f..57f13dba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +lumina-desktop (0.8.3.427-1nano) unstable; urgency=low + + * New git snapshot + + -- Christopher Roy Bratusek <nano@jpberlin.de> Thu, 26 Mar 2015 21:29:34 +0100 + lumina-desktop (0.8.3.372-1nano) unstable; urgency=low * new GIT snapshot 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 diff --git a/libLumina/LuminaOS-Linux.cpp b/libLumina/LuminaOS-Linux.cpp index ecf0adeb..9b4048d1 100644 --- a/libLumina/LuminaOS-Linux.cpp +++ b/libLumina/LuminaOS-Linux.cpp @@ -192,7 +192,16 @@ 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 |