summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2011-04-13 18:19:53 +0200
committerJonathan Bauer2011-04-13 18:19:53 +0200
commitac32b9b876e5f44f4c1a31f18c11dc06004aeee9 (patch)
tree526d9cc4613abedb0db2ae677c910d7f0c37933a
parentcursor hidden until URL loaded (diff)
downloadfbgui-ac32b9b876e5f44f4c1a31f18c11dc06004aeee9.tar.gz
fbgui-ac32b9b876e5f44f4c1a31f18c11dc06004aeee9.tar.xz
fbgui-ac32b9b876e5f44f4c1a31f18c11dc06004aeee9.zip
skip trigger checks if trigger is already present
-rw-r--r--src/fbgui.cpp20
-rw-r--r--src/main.cpp3
-rwxr-xr-xsrc/testApp.sh2
3 files changed, 10 insertions, 15 deletions
diff --git a/src/fbgui.cpp b/src/fbgui.cpp
index c252bcb..f130347 100644
--- a/src/fbgui.cpp
+++ b/src/fbgui.cpp
@@ -140,15 +140,8 @@ void fbgui::watchForTrigger()
// check if fileToTriggerURL already exists
if (fi.exists()){
qxtLog->debug() << "[watcher] " << fileToTriggerURL << " exists already!";
- // try to remove it
- QFile file(fi.absoluteFilePath());
- if (file.remove())
- qxtLog->debug() << "[watcher] Purged: " << file.fileName();
- else{
- // this shouldn't happen ...
- qxtLog->debug() << "[watcher] Could not remove: " << file.fileName();
- exit(EXIT_FAILURE);
- }
+ // load URL
+ if (checkHost()) loadURL();
}
else {
// watch the path where trigger file is expected
@@ -219,13 +212,14 @@ bool fbgui::checkHost() const
void fbgui::loadURL()
{
// disconnect _watcher, his job is done
- qxtLog->debug() << "[watcher] disconnected.";
- _watcher->disconnect(this);
- _watcher->deleteLater(); // memory problems with watcher
+ //qxtLog->debug() << "[watcher] disconnected.";
+ //_watcher->disconnect(this);
+ //_watcher->deleteLater(); // memory problems with watcher
qxtLog->debug() << "[gui] Loading URL...";
QByteArray postData = generatePOSTData();
qxtLog->debug() << "[gui] POST data: " << postData;
QNetworkRequest req(baseURL);
+ // show arrow cursor
qApp->setOverrideCursor(QCursor(Qt::ArrowCursor));
_webView->load(req, QNetworkAccessManager::PostOperation, postData);
}
@@ -234,7 +228,7 @@ void fbgui::loadURL()
* This method generates the POST data body.
*
* This method generates the POST data body. The body contains the
- * MAC address, an hardwarehas and a specific serial number.
+ * MAC address, an hardwarehash and a specific serial number.
* The hardwarehash is a MD5 hash over the MAC address and the
* mainboard serial number.
* The specific serial number is set at the creation of the usb boot stick.
diff --git a/src/main.cpp b/src/main.cpp
index 76d899c..c816157 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -173,7 +173,8 @@ int main(int argc, char *argv[])
qxtLog->debug() << "serialLocation: " << serialLocation.toUtf8();
qxtLog->debug() << "*******************************************";
- app.setOverrideCursor(QCursor(Qt::BlankCursor));
+ // set invisible cursor
+ qApp->setOverrideCursor(QCursor(Qt::BlankCursor));
// start fbgui
fbgui gui;
diff --git a/src/testApp.sh b/src/testApp.sh
index c924500..3f1fe82 100755
--- a/src/testApp.sh
+++ b/src/testApp.sh
@@ -13,7 +13,7 @@
# Note: all path are expected to be absolute.
# clean /tmp/fbgui
-rm -rf /tmp/fbgui
+#rm -rf /tmp/fbgui
# path to script (including script name)
script_path="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")"