diff options
author | wi <william.os4y@gmail.com> | 2015-04-12 22:21:19 +0200 |
---|---|---|
committer | wi <william.os4y@gmail.com> | 2015-04-12 22:21:19 +0200 |
commit | b26a12931cc2488359cc2bd26e508a01efded9d5 (patch) | |
tree | b27468f3aa3d79b878a7881934bbbc50ca158474 /libLumina/LuminaOS-Linux.cpp | |
parent | refactring of lumina-fileinfo: (diff) | |
parent | Fix location of ogg / vorbis gstreamer plugins (diff) | |
download | lumina-b26a12931cc2488359cc2bd26e508a01efded9d5.tar.gz lumina-b26a12931cc2488359cc2bd26e508a01efded9d5.tar.bz2 lumina-b26a12931cc2488359cc2bd26e508a01efded9d5.zip |
Merge remote-tracking branch 'upstream/master' into deskEditor
Diffstat (limited to 'libLumina/LuminaOS-Linux.cpp')
-rw-r--r-- | libLumina/LuminaOS-Linux.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/libLumina/LuminaOS-Linux.cpp b/libLumina/LuminaOS-Linux.cpp index 7587a29b..46a6371a 100644 --- a/libLumina/LuminaOS-Linux.cpp +++ b/libLumina/LuminaOS-Linux.cpp @@ -192,6 +192,24 @@ 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 + 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) + " used"; + return capacity; } #endif |