summaryrefslogtreecommitdiffstats
path: root/src/fbgui.cpp
diff options
context:
space:
mode:
authorJonathan Bauer2011-03-23 15:25:05 +0100
committerJonathan Bauer2011-03-23 15:25:05 +0100
commit322853fcb7a2cdc84b5e9d2ecd87f216c31b4ea0 (patch)
treeea8d1b4659be602cecbf0d40540856f5b7909ea7 /src/fbgui.cpp
parentMerge branch 'master' of git.openslx.org:lsfks/master-teamprojekt/fbgui (diff)
downloadfbgui-322853fcb7a2cdc84b5e9d2ecd87f216c31b4ea0.tar.gz
fbgui-322853fcb7a2cdc84b5e9d2ecd87f216c31b4ea0.tar.xz
fbgui-322853fcb7a2cdc84b5e9d2ecd87f216c31b4ea0.zip
loadURL() called when trigger file found
Diffstat (limited to 'src/fbgui.cpp')
-rw-r--r--src/fbgui.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/fbgui.cpp b/src/fbgui.cpp
index 9be1925..1a13b1a 100644
--- a/src/fbgui.cpp
+++ b/src/fbgui.cpp
@@ -33,10 +33,10 @@ fbgui::fbgui()
_webView = new QWebView(this);
// file watcher, disabled for now.
- //_webView->load(baseURL);
//watchFileTrigger();
- // PBS test (working dont delete)
+ //---------------------------------------------------------------------------------------
+ // PBS test begin
QString serial;
QFileInfo fi("/tmp/serial");
if (fi.exists())
@@ -53,12 +53,13 @@ fbgui::fbgui()
else
qxtLog->debug() << "No file /tmp/serial !";
// TODO append serial number to postData.
- //QByteArray postData = "mac=d8:d3:85:80:81:8b&hardwarehash=12341234123412341234123412341234&bootisoID=1&serial="+serial;
QNetworkRequest req(baseURL);
QByteArray postData = "mac=d8:d3:85:80:81:8b&hardwarehash=12341234123412341234123412341234&bootisoID=1&serial=";
_webView->load(req, QNetworkAccessManager::PostOperation, postData);
+ // PBS test end
+ //---------------------------------------------------------------------------------------
// debug console split or normal browser
if (debugMode == 1)
@@ -155,10 +156,7 @@ void fbgui::checkForTrigger(const QString& dirname)
QFileInfo fi(dirname + "/" + tfi.fileName());
if (fi.exists()){
qxtLog->debug() << fileToTriggerURL << " found!";
- if (checkHost()){
- qxtLog->debug() << "Loading URL...";
- _webView->load(baseURL);
- }
+ loadURL();
}
else
// do nothing / keep watching
@@ -196,3 +194,11 @@ void fbgui::watchFileTrigger()
QObject::connect(_watcher, SIGNAL(directoryChanged(const QString&)), this, SLOT(checkForTrigger(const QString&)));
}
}
+//-------------------------------------------------------------------------------------------
+void fbgui::loadURL(){
+ // TODO POST data stuff comes here
+ if (checkHost()){
+ qxtLog->debug() << "Loading URL...";
+ _webView->load(baseURL);
+ }
+}