diff options
Diffstat (limited to 'libLumina')
-rw-r--r-- | libLumina/LuminaOS-Debian.cpp | 5 | ||||
-rw-r--r-- | libLumina/LuminaOS-DragonFly.cpp | 5 | ||||
-rw-r--r-- | libLumina/LuminaOS-FreeBSD.cpp | 12 | ||||
-rw-r--r-- | libLumina/LuminaOS-Linux.cpp | 4 | ||||
-rw-r--r-- | libLumina/LuminaOS-OpenBSD.cpp | 4 | ||||
-rw-r--r-- | libLumina/LuminaOS-kFreeBSD.cpp | 6 | ||||
-rw-r--r-- | libLumina/LuminaOS-template.cpp | 5 | ||||
-rw-r--r-- | libLumina/LuminaOS.h | 3 |
8 files changed, 43 insertions, 1 deletions
diff --git a/libLumina/LuminaOS-Debian.cpp b/libLumina/LuminaOS-Debian.cpp index 8228d7c4..4f2032fa 100644 --- a/libLumina/LuminaOS-Debian.cpp +++ b/libLumina/LuminaOS-Debian.cpp @@ -193,4 +193,9 @@ int LOS::batterySecondsLeft(){ //Returns: estimated number of seconds remaining return 0; //not implemented yet for Linux } +//File Checksums +QStringList LOS::Checksums(QStringList filepaths){ //Return: checksum of the input file + return QStringList(); +} + #endif diff --git a/libLumina/LuminaOS-DragonFly.cpp b/libLumina/LuminaOS-DragonFly.cpp index dd9320fc..35bff04c 100644 --- a/libLumina/LuminaOS-DragonFly.cpp +++ b/libLumina/LuminaOS-DragonFly.cpp @@ -171,4 +171,9 @@ int LOS::batterySecondsLeft(){ //Returns: estimated number of seconds remaining return LUtils::getCmdOutput("apm -t").join("").toInt(); } +//File Checksums +QStringList LOS::Checksums(QStringList filepaths){ //Return: checksum of the input file + return QStringList(); +} + #endif diff --git a/libLumina/LuminaOS-FreeBSD.cpp b/libLumina/LuminaOS-FreeBSD.cpp index c58d2397..269bed52 100644 --- a/libLumina/LuminaOS-FreeBSD.cpp +++ b/libLumina/LuminaOS-FreeBSD.cpp @@ -183,4 +183,16 @@ int LOS::batterySecondsLeft(){ //Returns: estimated number of seconds remaining return LUtils::getCmdOutput("apm -t").join("").toInt(); } +//File Checksums +QStringList LOS::Checksums(QStringList filepaths){ //Return: checksum of the input file + 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; +} #endif diff --git a/libLumina/LuminaOS-Linux.cpp b/libLumina/LuminaOS-Linux.cpp index f0f427f4..7587a29b 100644 --- a/libLumina/LuminaOS-Linux.cpp +++ b/libLumina/LuminaOS-Linux.cpp @@ -190,4 +190,8 @@ int LOS::batterySecondsLeft(){ //Returns: estimated number of seconds remaining return 0; //not implemented yet for Linux } +//File Checksums +QStringList LOS::Checksums(QStringList filepaths){ //Return: checksum of the input file + return QStringList(); +} #endif diff --git a/libLumina/LuminaOS-OpenBSD.cpp b/libLumina/LuminaOS-OpenBSD.cpp index 2c86995a..7cf6c571 100644 --- a/libLumina/LuminaOS-OpenBSD.cpp +++ b/libLumina/LuminaOS-OpenBSD.cpp @@ -190,4 +190,8 @@ int LOS::batterySecondsLeft(){ //Returns: estimated number of seconds remaining return (min * 60); } +//File Checksums +QStringList LOS::Checksums(QStringList filepaths){ //Return: checksum of the input file + return QStringList(); +} #endif diff --git a/libLumina/LuminaOS-kFreeBSD.cpp b/libLumina/LuminaOS-kFreeBSD.cpp index ab9f9827..16c8e6eb 100644 --- a/libLumina/LuminaOS-kFreeBSD.cpp +++ b/libLumina/LuminaOS-kFreeBSD.cpp @@ -153,6 +153,10 @@ int LOS::batterySecondsLeft(){ //Returns: estimated number of seconds remaining return 0; //not implemented yet for Linux } +//File Checksums +QStringList LOS::Checksums(QStringList filepaths){ //Return: checksum of the input file + return QStringList(); +} + #endif #endif - diff --git a/libLumina/LuminaOS-template.cpp b/libLumina/LuminaOS-template.cpp index d481984f..c06b8b11 100644 --- a/libLumina/LuminaOS-template.cpp +++ b/libLumina/LuminaOS-template.cpp @@ -101,4 +101,9 @@ int LOS::batterySecondsLeft(){ //Returns: estimated number of seconds remaining return 0; //not implemented yet } +//File Checksums +QStringList LOS::Checksums(QStringList filepaths){ //Return: checksum of the input file + return QStringList(); +} + #endif diff --git a/libLumina/LuminaOS.h b/libLumina/LuminaOS.h index e0eb2895..92a7dc7e 100644 --- a/libLumina/LuminaOS.h +++ b/libLumina/LuminaOS.h @@ -80,6 +80,9 @@ public: static bool batteryIsCharging(); //Battery Time Remaining static int batterySecondsLeft(); //Returns: estimated number of seconds remaining + + //Get the checksum for a file + static QStringList Checksums(QStringList filepaths); //Return: checksum of each input file (same order) }; #endif |