aboutsummaryrefslogtreecommitdiff
path: root/libLumina
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-03-12 20:50:43 -0400
committerKen Moore <ken@pcbsd.org>2015-03-12 20:50:43 -0400
commit0864314ca2083ad584323997e1eabc570125d2a1 (patch)
treeaf2c529549b5ee78ea49946ff5add5c4eb962d18 /libLumina
parentChange the icon used for the "favorite files" button. Now it matches the User... (diff)
downloadlumina-0864314ca2083ad584323997e1eabc570125d2a1.tar.gz
lumina-0864314ca2083ad584323997e1eabc570125d2a1.tar.bz2
lumina-0864314ca2083ad584323997e1eabc570125d2a1.zip
Add Checksum support for FreeBSD, and tie it into lumina-fm.
Diffstat (limited to 'libLumina')
-rw-r--r--libLumina/LuminaOS-Debian.cpp5
-rw-r--r--libLumina/LuminaOS-DragonFly.cpp5
-rw-r--r--libLumina/LuminaOS-FreeBSD.cpp12
-rw-r--r--libLumina/LuminaOS-Linux.cpp4
-rw-r--r--libLumina/LuminaOS-OpenBSD.cpp4
-rw-r--r--libLumina/LuminaOS-kFreeBSD.cpp6
-rw-r--r--libLumina/LuminaOS-template.cpp5
-rw-r--r--libLumina/LuminaOS.h3
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
bgstack15