summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2011-03-07 22:57:12 +0100
committerJonathan Bauer2011-03-07 22:57:12 +0100
commited711e3a2d28fc80e5c62af35491780f07134b5e (patch)
treec972466360eb27f9848dbb0d82dcad1056bf2d29
parent.... (diff)
downloadfbgui-ed711e3a2d28fc80e5c62af35491780f07134b5e.tar.gz
fbgui-ed711e3a2d28fc80e5c62af35491780f07134b5e.tar.xz
fbgui-ed711e3a2d28fc80e5c62af35491780f07134b5e.zip
meh
-rw-r--r--src/sysInfo.cpp31
-rw-r--r--src/sysInfo.h15
2 files changed, 46 insertions, 0 deletions
diff --git a/src/sysInfo.cpp b/src/sysInfo.cpp
new file mode 100644
index 0000000..2c67cc1
--- /dev/null
+++ b/src/sysInfo.cpp
@@ -0,0 +1,31 @@
+#include <QString>
+#include <QTime>
+#include "SysInfo.h"
+
+extern bool debug;
+
+sysInfo::sysInfo(){}
+sysInfo::~sysInfo(){}
+QString sysInfo::getInfo(QString& infoName){
+ if (infoName == QString("time"))
+ return getTime();
+ if (infoName == QString("MAC"))
+ return getMACAddress();
+}
+QString sysInfo::getTime(){
+ return QTime::currentTime().toString("hh:mm:ss");
+}
+QString sysInfo::getMACAddress(){
+ QNetworkInterface *qNetI = new QNetworkInterface();
+ QList<QNetworkInterface> list;
+ list=qNetI->allInterfaces();
+ QString str;
+ QString macAddress;
+ for (int i = 0; i < list.size(); ++i) {
+ str = list.at(i).name();
+ macAddress = list.at(i).hardwareAddress();
+ if (debug) qDebug() << str << " : " << macAddress;
+ }
+ return macAddress;
+}
+
diff --git a/src/sysInfo.h b/src/sysInfo.h
new file mode 100644
index 0000000..86cc85a
--- /dev/null
+++ b/src/sysInfo.h
@@ -0,0 +1,15 @@
+#ifndef SYSTEMINFO_H
+#define SYSTEMINFO_H
+
+class sysInfo {
+ public:
+ sysInfo();
+ ~sysInfo();
+ QString getInfo(QString& infoName);
+
+ private:
+ QString getTime();
+ QString getMACAddress();
+}
+
+#endif // SYSTEMINFO_H