From ac32b9b876e5f44f4c1a31f18c11dc06004aeee9 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Wed, 13 Apr 2011 18:19:53 +0200 Subject: skip trigger checks if trigger is already present --- src/fbgui.cpp | 20 +++++++------------- src/main.cpp | 3 ++- src/testApp.sh | 2 +- 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##*/}")" -- cgit v1.2.3-55-g7522