aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Neumann <mneumann@ntecs.de>2015-08-16 16:40:09 +0200
committerMichael Neumann <mneumann@ntecs.de>2015-08-16 16:40:09 +0200
commitade698681bb7d095960f459ba08420bb7a383966 (patch)
treef2c8fe7a500b1cb145e749beea89e8631d17425c
parentImplement Battery hooks for DragonFly (diff)
downloadlumina-ade698681bb7d095960f459ba08420bb7a383966.tar.gz
lumina-ade698681bb7d095960f459ba08420bb7a383966.tar.bz2
lumina-ade698681bb7d095960f459ba08420bb7a383966.zip
DragonFly: Sync LOS::Checksums() with FreeBSD
-rw-r--r--libLumina/LuminaOS-DragonFly.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/libLumina/LuminaOS-DragonFly.cpp b/libLumina/LuminaOS-DragonFly.cpp
index 73815ea0..0dd10b88 100644
--- a/libLumina/LuminaOS-DragonFly.cpp
+++ b/libLumina/LuminaOS-DragonFly.cpp
@@ -215,7 +215,15 @@ 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("md5 \""+filepaths.join("\" \"")+"\"");
+ for(int i=0; i<info.length(); i++){
+ if( !info[i].contains(" = ") ){ info.removeAt(i); i--; }
+ else{
+ //Strip out the extra information
+ info[i] = info[i].section(" = ",1,1);
+ }
+ }
+ return info;
}
//file system capacity
bgstack15