diff options
| author | Jonathan Bauer | 2011-03-07 23:42:54 +0100 |
|---|---|---|
| committer | Jonathan Bauer | 2011-03-07 23:42:54 +0100 |
| commit | e9e362bc2430fa54bfe1fcab8eb361721d93a4f1 (patch) | |
| tree | 0896dbf72fe8e257b8843d819f0d9873fd441b0c /src | |
| parent | typos (diff) | |
| download | fbgui-e9e362bc2430fa54bfe1fcab8eb361721d93a4f1.tar.gz fbgui-e9e362bc2430fa54bfe1fcab8eb361721d93a4f1.tar.xz fbgui-e9e362bc2430fa54bfe1fcab8eb361721d93a4f1.zip | |
jso
Diffstat (limited to 'src')
| -rw-r--r-- | src/JSObject.cpp | 16 | ||||
| -rw-r--r-- | src/JSObject.h | 3 | ||||
| -rw-r--r-- | src/fbgui.cpp | 2 | ||||
| -rw-r--r-- | src/sysInfo.cpp | 3 |
4 files changed, 17 insertions, 7 deletions
diff --git a/src/JSObject.cpp b/src/JSObject.cpp index 2d926b5..708e825 100644 --- a/src/JSObject.cpp +++ b/src/JSObject.cpp @@ -6,12 +6,13 @@ */ #include "JSObject.h" +#include "sysInfo.h" -extern QUrl baseURL; extern bool debug; //------------------------------------------------------------------------------------------------------- JSObject::JSObject(QWebFrame *parent) { + // check for better way to use evaluateJavaScript() _parent = parent; } //------------------------------------------------------------------------------------------------------- @@ -20,9 +21,16 @@ JSObject::~JSObject() {} /* TEST */ QString JSObject::getInfo(QString info) { + static sysInfo si; if (debug) qDebug() << "Requested info: " << info; - if (info == QString("mac")) - return "MAC_ADDRESS"; + if (debug) qDebug() << "sysInfo output: " << si.getInfo(info); + if (info == QString("time")){ + return si.getInfo(info); + } + if (info == QString("mac")){ + return si.getInfo(info); + //return "MAC_ADDRESS"; + } else return "no value"; } @@ -57,7 +65,7 @@ void JSObject::updateProgressBar(int i) void JSObject::quitAll() { - qDebug() << "Quit signal."; + if (debug) qDebug() << "Quit signal."; emit signalQuitAll(); } diff --git a/src/JSObject.h b/src/JSObject.h index 18ae5bb..ecbc4f2 100644 --- a/src/JSObject.h +++ b/src/JSObject.h @@ -11,7 +11,7 @@ #define JSOBJECT_H_ #include "fbgui.h" - +#include "sysInfo.h" class JSObject : public QObject @@ -20,6 +20,7 @@ class JSObject : public QObject private: QWebFrame* _parent; + sysInfo sim; public: JSObject(QWebFrame* parent); diff --git a/src/fbgui.cpp b/src/fbgui.cpp index 8f6fc88..90eb8f6 100644 --- a/src/fbgui.cpp +++ b/src/fbgui.cpp @@ -24,7 +24,7 @@ fbgui::fbgui(QApplication *parent) JSObject* jso = new JSObject(webView->page()->mainFrame()); QObject::connect(webView->page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), jso, SLOT(attachToDOM())); - QObject::connect(jso, SIGNAL(signalQuitAll()), parent, SLOT(quit())); + //QObject::connect(jso, SIGNAL(signalQuitAll()), parent, SLOT(quit())); /* Init Download Manager */ DownloadManager* dm = new DownloadManager(); diff --git a/src/sysInfo.cpp b/src/sysInfo.cpp index 647f1c1..575c801 100644 --- a/src/sysInfo.cpp +++ b/src/sysInfo.cpp @@ -7,6 +7,7 @@ extern bool debug; sysInfo::sysInfo(){} sysInfo::~sysInfo(){} QString sysInfo::getInfo(QString& infoName){ + if (debug) qDebug() << "sysInfo : getInfo(" << infoName << ")"; if (infoName == QString("time")) return getTime(); if (infoName == QString("MAC")) @@ -26,6 +27,6 @@ QString sysInfo::getMACAddress(){ macAddress = list.at(i).hardwareAddress(); if (debug) qDebug() << str << " : " << macAddress; } + // returns only the latest found interface ... to fix return macAddress; } - |
